-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: update @rocket.chat/sdk to 2.0.0-mobile #7574
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
+4,513
−1,775
Merged
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
6def48c
chore: update @rocket.chat/sdk to mobile branch HEAD
diegolmello 34e6d0f
test: integration-test the app against the real SDK lib
diegolmello 37925d9
chore: bump @rocket.chat/sdk to mobile HEAD 4202408
diegolmello e32cca6
chore: bump @rocket.chat/sdk to mobile HEAD and drop local module shims
diegolmello fa7d715
fix: address review — await voip listener, filter undefined upload he…
diegolmello 26c208c
Merge branch 'develop' into new-sdk
diegolmello 7b8f589
chore: bump @rocket.chat/sdk to mobile HEAD 383e457b and drop sdk cli…
diegolmello 574125b
fix: remove unreachable ping-age branch in classifySocketHealth
diegolmello 736de5e
fix(login): surface a failure instead of hanging on a missing login r…
diegolmello 341470f
fix(upload): refuse an upload without auth headers
diegolmello 4547349
fix(2fa): report a cancelled two-factor prompt as a cancellation
diegolmello 8ee07d5
fix(2fa): stop reporting a deliberate cancellation as an error
diegolmello 81f32c6
fix: settle the promises that could strand a caller
diegolmello ef8549e
chore: drop a comment describing the removed empty two-factor response
diegolmello 902cb1e
fix(2fa): cover the cancellation paths that bypass central suppression
diegolmello abcf41d
fix(upload): validate auth headers when the upload is sent
diegolmello 654e8c0
fix(2fa): stop alerting when the avatar prompt is cancelled
diegolmello b47c776
chore: adopt the SDK's login types and test against the real lib (#7582)
diegolmello 155f4ea
chore: update @rocket.chat/sdk to mobile HEAD (#7583)
diegolmello 6d3cbd5
chore: narrow subscribeSettings and drop its unused SDK type import (…
diegolmello e5e5929
test: use the app's own TDriver instead of reaching into SDK internal…
diegolmello 57409d7
chore: remove lint suppressions for a disabled rule (#7586)
diegolmello d37a350
Merge remote-tracking branch 'origin/develop' into new-sdk
diegolmello f9930e8
chore: bump @rocket.chat/sdk to mobile HEAD b6453cc3
diegolmello dd5da3b
test: cover multi-workspace switching (#7590)
diegolmello ac50470
fix: server version recorded as undefined when falling back to anothe…
diegolmello 6a4e293
fix(logout): keep other workspaces reachable after a forced logout (#…
diegolmello c2e0de3
fix: give every saga exit a user-facing root (#7592)
diegolmello 0f2a862
test: cover the background/foreground socket resume path (#7589)
diegolmello 5094c14
fix: make sdk.current nullable and guard its call sites (#7587)
diegolmello 778fa86
test: cover messages received while the device is offline (#7596)
diegolmello ff9d54e
chore: drop comments that restate or narrate code
diegolmello 150fd8c
refactor: share the logged-in server lookup between the init and logi…
diegolmello 0e547f2
chore: drop the outcome enumeration from the recovery docblock
diegolmello bf54234
refactor: type the logged-in server lookup with TServerModel
diegolmello e37fd25
fix: use the room _id when navigating to a newly created direct message
diegolmello 8746684
Merge branch 'develop' into new-sdk
diegolmello 8382470
chore: bump @rocket.chat/sdk to latest mobile HEAD
diegolmello 323b9ff
Merge branch 'develop' into new-sdk
diegolmello 5ddc693
fix: cold start drops a restored server when reading a pending notifi…
diegolmello ea52409
refactor: centralise the server lookups behind the Server service (#7…
diegolmello 56d3bb7
fix: distinguish 2FA retry from cancel when saving the profile
diegolmello 34a40c5
Merge branch 'new-sdk' into diegolmello/fix-profileview-2fa-return
diegolmello 3311a2b
test: pin the normalized 2FA retry credentials for ldap and crowd (#7…
diegolmello 6062025
Revert "fix: distinguish 2FA retry from cancel when saving the profile"
diegolmello 0c041fb
fix: stale 2FA code survives a cancelled prompt in ChangePasswordView…
diegolmello 6d5a97b
fix: distinguish 2FA retry from cancel when saving the profile (#7607)
diegolmello dbab12f
refactor: import the 2FA cancellation guard from its leaf module (#7609)
diegolmello 76c80dc
refactor: keep localized upload-auth copy out of Error.message
diegolmello 5241765
Merge remote-tracking branch 'origin/new-sdk' into new-sdk-5
diegolmello 246006d
Merge remote-tracking branch 'origin/develop' into new-sdk-5
diegolmello 0d4ebaa
test: mock twoFactor from its module path
diegolmello cc76989
fix: load history for rooms whose sync cursor was never seeded
diegolmello 94badcf
Merge remote-tracking branch 'origin/develop' into new-sdk-7
diegolmello 3ca9bf6
chore: bump @rocket.chat/sdk to latest mobile HEAD
diegolmello c994f6f
chore: point sniffler global at loggedInServer
diegolmello 03be66d
chore: bump @rocket.chat/sdk to SDK #421 head (#7618)
diegolmello 39b5e2c
chore: bump @rocket.chat/sdk to SDK #429 head
diegolmello 72282c8
chore: drop dead SDK exports and name what the socket and login helpe…
diegolmello 8236adf
chore: bump @rocket.chat/sdk to mobile HEAD (2.0.0-mobile)
diegolmello 5018507
Merge remote-tracking branch 'origin/new-sdk' into new-sdk-7
diegolmello eac99cc
Merge remote-tracking branch 'origin/develop' into new-sdk-7
diegolmello 3901016
Merge branch 'develop' into new-sdk
diegolmello 08f7fb9
Merge branch 'develop' into new-sdk
diegolmello 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
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 |
|---|---|---|
|
|
@@ -263,5 +263,6 @@ output.utils = { | |
| post, | ||
| login, | ||
| getDeepLink, | ||
| createDM | ||
| createDM, | ||
| sleep | ||
| }; | ||
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,55 @@ | ||
| appId: ${APP_ID} | ||
| name: Messages received while device is offline | ||
| onFlowStart: | ||
| - runFlow: '../../helpers/setup.yaml' | ||
| onFlowComplete: | ||
| - setAirplaneMode: disabled | ||
| - stopApp: ${APP_ID} | ||
| - evalScript: ${output.utils.deleteCreatedUsers()} | ||
| tags: | ||
| - test-3 | ||
| - android-only | ||
|
|
||
| --- | ||
| - evalScript: ${output.user = output.utils.createUser()} | ||
| - evalScript: ${output.sender = output.utils.createUser()} | ||
| - evalScript: ${output.tag = 'offline-' + output.random(6)} | ||
| - evalScript: ${output.utils.sendMessage(output.sender.username, output.sender.password, '@' + output.user.username, output.tag + '-baseline')} | ||
|
|
||
| - runFlow: | ||
| file: '../../helpers/login-with-deeplink.yaml' | ||
| env: | ||
| USERNAME: ${output.user.username} | ||
| PASSWORD: ${output.user.password} | ||
| CLEAR_STATE: true | ||
| - runFlow: | ||
| file: '../../helpers/navigate-to-room.yaml' | ||
| env: | ||
| ROOM: ${output.sender.username} | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: 'message-content-${output.tag}-baseline' | ||
| timeout: 60000 | ||
|
|
||
| # should deliver every message that arrived while the device had no network | ||
| - setAirplaneMode: enabled | ||
| - evalScript: ${output.utils.sendMessage(output.sender.username, output.sender.password, '@' + output.user.username, output.tag + '-1')} | ||
| - evalScript: ${output.utils.sendMessage(output.sender.username, output.sender.password, '@' + output.user.username, output.tag + '-2')} | ||
| - evalScript: ${output.utils.sendMessage(output.sender.username, output.sender.password, '@' + output.user.username, output.tag + '-3')} | ||
| - evalScript: ${output.utils.sleep(5000)} | ||
| - assertNotVisible: | ||
| id: 'message-content-${output.tag}-1' | ||
| - assertNotVisible: | ||
| id: 'message-content-${output.tag}-2' | ||
| - assertNotVisible: | ||
| id: 'message-content-${output.tag}-3' | ||
| - setAirplaneMode: disabled | ||
|
|
||
| - extendedWaitUntil: | ||
| visible: | ||
| id: 'message-content-${output.tag}-3' | ||
| timeout: 120000 | ||
| - assertVisible: | ||
| id: 'message-content-${output.tag}-1' | ||
| - assertVisible: | ||
| id: 'message-content-${output.tag}-2' |
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 |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { act, fireEvent, render, waitFor } from '@testing-library/react-native'; | ||
|
|
||
| import TwoFactor from '.'; | ||
| import { twoFactor } from '../../lib/services/twoFactor/twoFactor'; | ||
| import { isTwoFactorCancelled } from '../../lib/services/twoFactor/twoFactorCancelled'; | ||
|
|
||
| jest.mock('../../lib/services/restApi', () => ({ | ||
| sendEmailCode: jest.fn() | ||
| })); | ||
|
|
||
| jest.mock('../../lib/hooks/useMasterDetail', () => ({ | ||
| useMasterDetail: () => false | ||
| })); | ||
|
|
||
| const requestTwoFactor = () => twoFactor({ method: 'totp', invalid: false }); | ||
|
|
||
| describe('TwoFactor', () => { | ||
| it('cancels the displaced prompt and resolves the newest one', async () => { | ||
| const { getByTestId } = render(<TwoFactor />); | ||
|
|
||
| let displacedResult: Promise<unknown> | undefined; | ||
| let newest: ReturnType<typeof requestTwoFactor> | undefined; | ||
| await act(() => { | ||
| displacedResult = requestTwoFactor().catch(error => error); | ||
| newest = requestTwoFactor(); | ||
| }); | ||
|
|
||
| await waitFor(() => expect(getByTestId('two-factor-input')).toBeTruthy()); | ||
|
|
||
| expect(isTwoFactorCancelled(await displacedResult!)).toBe(true); | ||
|
|
||
| fireEvent.changeText(getByTestId('two-factor-input'), '123456'); | ||
| await act(() => { | ||
| fireEvent.press(getByTestId('two-factor-send')); | ||
| }); | ||
|
|
||
| await expect(newest!).resolves.toEqual({ twoFactorCode: '123456', twoFactorMethod: 'totp' }); | ||
| }); | ||
| }); |
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 was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export type { | ||
| ICredentialsCasAPI, | ||
| ICredentialsPasswordAPI, | ||
| ICredentialsSamlAPI, | ||
| ILoginCredentials | ||
| } from '@rocket.chat/sdk/interfaces'; |
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
Oops, something went wrong.
Oops, something went wrong.
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.