Conversation

SelaseKay

Description

Expose experimentalForceLongPolling on firestore Settings

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.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (melos run analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

@google-claGoogle CLA

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.

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,
Copy link
Contributor

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

Copy link
Contributor Author

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.
@SelaseKaySelaseKay reopened this Aug 20, 2024
@LyokoneLyokone changed the title fix(firestore): expose experimentalForceLongPolling on FireStoreSettings feat(firestore, web): expose experimentalForceLongPolling on web Aug 20, 2024
…ebExperimentalForceLongPolling, timeoutSeconds)
@SelaseKaySelaseKay changed the title feat(firestore, web): expose experimentalForceLongPolling on web feat(firestore, web): expose webExperimentalForceLongPolling, webExperimentalAutoDetectLongPolling and timeoutSeconds on web Aug 21, 2024
@@ -315,6 +315,8 @@ class FirebaseFirestore extends FirebasePluginPlatform {
persistenceEnabled: settings.persistenceEnabled,
host: settings.host,
cacheSizeBytes: settings.cacheSizeBytes,
webExperimentalForceLongPolling: settings.webExperimentalForceLongPolling,
webExperimentalAutoDetectLongPolling: settings.webExperimentalAutoDetectLongPolling,
Copy link
Contributor

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

Comment on lines 19 to 21
this.webExperimentalForceLongPolling = true,
this.webExperimentalAutoDetectLongPolling = true,
this.timeoutSeconds = 30,
Copy link
Contributor

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(
Copy link
Contributor

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.

Comment on lines 156 to 159
/// 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.
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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.

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

@LyokoneLyokone merged commit 6ec2a10 into firebase:main Sep 3, 2024
19 of 21 checks passed
@firebasefirebase locked and limited conversation to collaborators Oct 4, 2024
Sign up for free to subscribe to this conversation on . Already have an account? Sign in.
None yet
None yet

Successfully merging this pull request may close these issues.

🐛 [cloud_firestore] experimentalForceLongPolling option