Skip to content
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

Fix/persisted native message system #11039

Merged
merged 3 commits into from
Feb 8, 2024
Merged

Conversation

PeKne
Copy link
Contributor

@PeKne PeKne commented Feb 5, 2024

Description

  • 9c69ee0: message system made persistent
  • 730251c: messages validate on every device connection/selection

Related Issue

Resolve #10979

@PeKne PeKne added the mobile Suite Lite issues and PRs label Feb 5, 2024
@PeKne PeKne requested review from a team, tomasklim and matejkriz as code owners February 5, 2024 14:03
const isAnyOfMessageSystemAffectingActions = isAnyOf(messageSystemActions.fetchSuccessUpdate);
const isAnyOfMessageSystemAffectingActions = isAnyOf(
messageSystemActions.fetchSuccessUpdate,
deviceActions.selectDevice,
Copy link
Contributor

@vytick vytick Feb 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems, that there are also other actions that maybe should trigger the check - deviceChange, disconnect, forget, auth. Wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • deviceChanged and auth are not relevant (no relevant change for available message system conditions can be updated)
  • disconnect and forget would also trigger selectDevice if selected, but not relevant if not selected

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but definitelly I'm glad you asked 👍 ❤️

Copy link
Member

@matejkriz matejkriz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIXED in 1b5794b


Have you found a way to test it? I've tried to test it locally with custom local config (simulating remote fetch failed) and I'm now facing this error:

 ERROR  [Error: Unable to resolve module ./suite-common/message-system/files/config.v1 from /Users/matejkriz/Projects/trezor-suite/suite-native/app/.:

None of these files exist:
  * suite-common/message-system/files/config.v1(.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.mjs|.native.mjs|.mjs|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.cjs|.native.cjs|.cjs|.android.scss|.native.scss|.scss|.android.sass|.native.sass|.sass|.android.css|.native.css|.css)

But I believe it should work... #7936 (comment)

@matejkriz
Copy link
Member

@tomasklim please check 1b5794b I know it's not great, but hopefully not terrible?

matejkriz

This comment was marked as duplicate.

Copy link
Member

@matejkriz matejkriz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

device condition works nice for me
image

@PeKne
Copy link
Contributor Author

PeKne commented Feb 7, 2024

/rebase

Copy link

github-actions bot commented Feb 7, 2024

PeKne and others added 3 commits February 7, 2024 21:40
- Conditional import for some reason start using wrong base path on mobile. Regular import on top of the file fix the issue.
- Potential downside is that local config is fully bundled in the code so it can increase bundle size on web.
@trezor-ci trezor-ci force-pushed the fix/persisted-native-message-system branch from 1b5794b to c200b55 Compare February 7, 2024 21:40
@PeKne PeKne merged commit bd63532 into develop Feb 8, 2024
31 of 32 checks passed
@PeKne PeKne deleted the fix/persisted-native-message-system branch February 8, 2024 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Suite Lite issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Message system state is not presistent
3 participants