-
Notifications
You must be signed in to change notification settings - Fork 945
Adding experimentalAutoDetectLongPolling #3724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
33d69f3
Upgrade to latest version of closure
rafikhan 35d4713
Adding changeset
rafikhan d24a58f
Updating changeset message
rafikhan 6084312
Fixing stylization in changeset copy
rafikhan a2a8817
Merge branch 'master' into khanrafi/webchannelupgrade
rafikhan 433c8ba
Merge branch 'master' into khanrafi/webchannelupgrade
rafikhan 4f544d8
WIP
rafikhan e778894
Merge branch 'master' into khanrafi/webchannelupgrade
rafikhan cffed37
Merge branch 'master' of github.com:firebase/firebase-js-sdk into kha…
rafikhan bb5fe2c
Updating to match new patterns
rafikhan 59c8900
Making member names match conventions on others
rafikhan dbffc65
Making the linter happy
rafikhan bee717c
Fixing bug caught by unit tests and misc polish
rafikhan 7356673
Turning auto detection on by default
rafikhan 14887c4
Turning auto detection on by default
rafikhan 66ed0bf
Merge branch 'khanrafi/webchannelupgrade' of github.com:firebase/fire…
rafikhan fb6a370
Update packages/firestore/src/util/input_validation.ts
rafikhan 458c75a
Update packages/firebase/index.d.ts
rafikhan ecd8469
Changing default to false
rafikhan 3c34f6d
Fixing grammar
rafikhan c26a7ec
Merge branch 'master' into khanrafi/webchannelupgrade
rafikhan f9859a9
Adding integration test
rafikhan 1d8d8c3
Undoing formatting changes
rafikhan 5222ae7
Resetting hard code to false
rafikhan 9f756ad
Update packages/firestore/src/core/database_info.ts
rafikhan 94095b7
Update packages/firestore/test/integration/api/database.test.ts
rafikhan 500b3d9
Create yellow-turkeys-lay.md
rafikhan 2eeffd2
Update .changeset/yellow-turkeys-lay.md
rafikhan 490c0ef
Update .changeset/yellow-turkeys-lay.md
rafikhan ed94332
Update index.d.ts
rafikhan 1b10fb5
Update yellow-turkeys-lay.md
rafikhan 64fa5fb
Merge branch 'master' of github.com:firebase/firebase-js-sdk into kha…
rafikhan c972e4c
Updating unit test to contain proper error string
rafikhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"@firebase/firestore-types": minor | ||
"@firebase/firestore": minor | ||
"@firebase/webchannel-wrapper": minor | ||
"firebase": minor | ||
--- | ||
|
||
Adds a new `experimentalAutoDetectLongPolling` to FirestoreSettings. When | ||
enabled, the SDK's underlying transport (WebChannel) automatically detects if | ||
long-polling should be used. This is very similar to | ||
`experimentalForceLongPolling`, but only uses long-polling if required. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,12 +26,13 @@ import * as firebaseExport from '../util/firebase_export'; | |
import { | ||
apiDescribe, | ||
withTestCollection, | ||
withTestDbsSettings, | ||
withTestDb, | ||
withTestDbs, | ||
withTestDoc, | ||
withTestDocAndInitialData | ||
} from '../util/helpers'; | ||
import { DEFAULT_SETTINGS } from '../util/settings'; | ||
import { DEFAULT_SETTINGS, DEFAULT_PROJECT_ID } from '../util/settings'; | ||
|
||
use(chaiAsPromised); | ||
|
||
|
@@ -1600,4 +1601,30 @@ apiDescribe('Database', (persistence: boolean) => { | |
}); | ||
}); | ||
}); | ||
|
||
it('can set and get data with auto detect long polling enabled', () => { | ||
const settings = { | ||
...DEFAULT_SETTINGS, | ||
experimentalAutoDetectLongPolling: true | ||
}; | ||
|
||
return withTestDbsSettings( | ||
persistence, | ||
DEFAULT_PROJECT_ID, | ||
settings, | ||
1, | ||
async ([db]) => { | ||
const data = { name: 'Rafi', email: '[email protected]' }; | ||
const doc = await db.collection('users').doc(); | ||
|
||
return doc | ||
.set(data) | ||
.then(() => doc.get()) | ||
.then(snapshot => { | ||
expect(snapshot.exists).to.be.ok; | ||
expect(snapshot.data()).to.deep.equal(data); | ||
}); | ||
} | ||
); | ||
}); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.