-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: update @rocket.chat/sdk to mobile branch HEAD #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
Open
diegolmello
wants to merge
38
commits into
develop
Choose a base branch
from
new-sdk
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
38 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { act, fireEvent, render, waitFor } from '@testing-library/react-native'; | ||
|
|
||
| import TwoFactor from '.'; | ||
| import { isTwoFactorCancelled, twoFactor } from '../../lib/services/twoFactor'; | ||
|
|
||
| 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,12 @@ | ||
| export type { | ||
| ICredentialsAppleAPI, | ||
| ICredentialsAuthenticated, | ||
| ICredentialsCasAPI, | ||
| ICredentialsCrowdAPI, | ||
| ICredentialsLdapAPI, | ||
| ICredentialsOAuth, | ||
| ICredentialsPasswordAPI, | ||
| ICredentialsSamlAPI, | ||
| ICredentialsTotpAPI, | ||
| 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.