transport-module/http2 protocol support using package:http2 for io#150
transport-module/http2 protocol support using package:http2 for io#150mohitpubnub wants to merge 10 commits into
Conversation
…ng and disposal to make it compatible with granual apis of package:http2.
…trnsaport as well.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 7 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
…beat interval. recommended way to provide heartbeat interval is via presence endpoint.
|
|
||
| // Origin does not support HTTP/2 — fall back to HTTP/1.1 for this request. | ||
| if (h2 == null) { | ||
| return _responseViaHttp1(data, currentUri, currentHeaders, currentBody); |
There was a problem hiding this comment.
_responseViaHttp1 will override existing timer under _sendTimeoutTimer without its cancellation. Shouldn't you cancel any existing timer before the fallback?
There was a problem hiding this comment.
yes. Here, The orphaned h2-path timer stays live until it fires. Because both timers use the same sendTimeout duration and the h2 timer started earlier (it includes the ALPN-probe time), it fires first — so on a slow request it could trip the timeout slightly early, and in all cases it keeps a live Timer + closure around needlessly.
| /// keep-alive timers. Optional to call — idle connections are otherwise | ||
| /// reaped automatically — but useful for a deterministic shutdown. No-op on | ||
| /// the web platform. | ||
| void dispose() { |
There was a problem hiding this comment.
Is this method used? I see that top-level PubNub class has a dispose() method, but it does not forward a call here
There was a problem hiding this comment.
It seems Call from PubNub.dispose() in default.dart not calling dispose of Networking module.
It should PubNub.dispose() → NetworkingModule.dispose() → disposeTransport(this) → disposeHttp2Manager(module), which closes pooled connections and cancels their keep-alive/idle timers. On web/stub, disposeTransport remains a no-op.
|
@pubnub-release-bot release dart as v8.0.0 |
feat(networking-module): added support for h2 protocol using http2 package.
added support for h2 protocol using http2 package.
BREAKING CHANGES: Required minimum dart sdk version is 3.2.0/flutter 3.16.x