Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice, I think you'll also need to add
The PR can be marked as feat(firestore, web)
@@ -315,6 +315,7 @@ class FirebaseFirestore extends FirebasePluginPlatform { | |||
persistenceEnabled: settings.persistenceEnabled, | |||
host: settings.host, | |||
cacheSizeBytes: settings.cacheSizeBytes, | |||
experimentalForceLongPolling: settings.experimentalForceLongPolling, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's only available for web, I would rename it webExperimentalForceLongPolling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
…lForceLongPolling since it applies to web only.
experimentalForceLongPolling
on web …ebExperimentalForceLongPolling, timeoutSeconds)
experimentalForceLongPolling
on webwebExperimentalForceLongPolling
, webExperimentalAutoDetectLongPolling
and timeoutSeconds
on web @@ -315,6 +315,8 @@ class FirebaseFirestore extends FirebasePluginPlatform { | |||
persistenceEnabled: settings.persistenceEnabled, | |||
host: settings.host, | |||
cacheSizeBytes: settings.cacheSizeBytes, | |||
webExperimentalForceLongPolling: settings.webExperimentalForceLongPolling, | |||
webExperimentalAutoDetectLongPolling: settings.webExperimentalAutoDetectLongPolling, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing timeoutSeconds exposed in the user facing lib. I think it should be hidden being an objet like in the original web SDK. experimentalLongPollingOptions
this.webExperimentalForceLongPolling = true, | ||
this.webExperimentalAutoDetectLongPolling = true, | ||
this.timeoutSeconds = 30, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably not set any default so we can rely on the default value of the underlying JS SDK.
@@ -152,18 +152,30 @@ class FirebaseFirestoreWeb extends FirebaseFirestorePlatform { | |||
)); | |||
} | |||
dynamic experimentalLongPollingOptions = firestore_interop.ExperimentalLongPollingOptions( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We try to avoid using dynamic
, you can probably type that as JSAny.
/// Options that configure the SDK’s underlying network transport (WebChannel) when long-polling is used | ||
/// These options are only used if experimentalForceLongPolling is true | ||
/// or if experimentalAutoDetectLongPolling is true and the auto-detection determined that long-polling was needed. | ||
/// Otherwise, these options have no effect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one can be shorten to match Options that configure the SDK’s underlying network transport (WebChannel) when long-polling is used.
on https://firebase.google.com/docs/reference/js/firestore_.experimentallongpollingoptions.md#experimentallongpollingoptions_interface
///This is very similar to [webExperimentalForceLongPolling], but only uses long-polling if required. | ||
final bool? webExperimentalAutoDetectLongPolling; | ||
final WebExperimentalLongPollingOptions? webExperimentalLongPollingOptions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a documentation here
Options that configure the SDK’s underlying network transport (WebChannel) when long-polling is used.These options are only used if experimentalForceLongPolling is true or if experimentalAutoDetectLongPolling is true and the auto-detection determined that long-polling was needed. Otherwise, these options have no effect.
///This is very similar to [webExperimentalForceLongPolling], but only uses long-polling if required. | ||
final bool? webExperimentalAutoDetectLongPolling; | ||
final WebExperimentalLongPollingOptions? webExperimentalLongPollingOptions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a documentation here
Options that configure the SDK’s underlying network transport (WebChannel) when long-polling is used.These options are only used if experimentalForceLongPolling is true or if experimentalAutoDetectLongPolling is true and the auto-detection determined that long-polling was needed. Otherwise, these options have no effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should add to firestore e2e tests to see what happens when it is passed via interop layer. Other than that, and @Lyokone's requests, LGTM
6ec2a10
into firebase:main Uh oh!
There was an error while loading. Please reload this page.
Description
Expose
experimentalForceLongPolling
on firestoreSettings
Related Issues
closes 11149
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
).This will ensure a smooth and quick review process. Updating the
pubspec.yaml
and changelogs is not required.///
).melos run analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?