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

As an user, in case my account have expirated, I want to be informed and have a process to reactivate my account #88

Closed
jdauphant opened this issue Jul 8, 2022 · 16 comments · Fixed by #306
Assignees
Labels
enhancement New feature or request P1 Priority 1 web

Comments

@jdauphant
Copy link
Contributor

jdauphant commented Jul 8, 2022

Your use case

In case your account is disactivate, inform the user and permit to send an email to reactivate the account

Have you considered any alternatives?

No response

Additional context

No response

Keywords : expiration renew

@jdauphant jdauphant added enhancement New feature or request v4 web labels Jul 8, 2022
@estellecomment
Copy link
Contributor

Is this the deactivation for which you need to click a link in your email ? ("Renouvelez votre compte tchap")
If so, the backend sends the link, and the link is a page served by the backend, so there is nothing to do on the frontend.

@jdauphant
Copy link
Contributor Author

There is an alerting popup in the frontend that inform the desactivation of the account and permit the reactivation of the account.

@jdauphant
Copy link
Contributor Author

(I don't have the screenshot)

@jdauphant jdauphant changed the title Reactivate account interface As an user, in case my account is disactivate, I want to be informed and have a process to reactivate my account Jul 11, 2022
@jdauphant
Copy link
Contributor Author

jdauphant commented Jul 11, 2022

On tchap-web-v2 :
image

@jdauphant
Copy link
Contributor Author

There is proposition with a code to enter : https://github.com/tchapgouv/tchap-design/issues/26

@mcalinghee mcalinghee changed the title As an user, in case my account is disactivate, I want to be informed and have a process to reactivate my account As an user, in case my account is deactivated, I want to be informed and have a process to reactivate my account Jul 11, 2022
@mcalinghee
Copy link
Contributor

On tchap-web-v4 :
image

@estellecomment
Copy link
Contributor

Let's try à beta without this. (if it's a blocker we'll reconsider)

@jdauphant
Copy link
Contributor Author

jdauphant commented Jul 19, 2022

We can implement with something like that :

        let newEmailRequested = false;
 /**
     * React on Sync State Changed
     * @param state 
     * @param prevState 
     * @param data 
     */
    static onSyncStateChange(state: SyncState, prevState: SyncState, data: ISyncStateData) {
        if (data && data.error && data.error.errcode === "ORG_MATRIX_EXPIRED_ACCOUNT") {
            Modal.createTrackedDialog('Expired Account Dialog', '', ExpiredAccountDialog, {
                newEmailRequested: newEmailRequested,
                onRequestNewEmail: () => {
                    newEmailRequested = true;
                    TchapUtils.requestNewExpiredAccountEmail();
                },
                onFinished: () => {
                    newEmailRequested = false;
                },
            });
        }
    }

    static setupExpirationAccount() {
        const cli = MatrixClientPeg.get();

        this.boundOnSyncStateChange = this.boundOnSyncStateChange || this.onSyncStateChange.bind(this);

        cli.on(ClientEvent.Sync, this.boundOnSyncStateChange);

    }

     /**
     * Request a new validation email for expired account.
     */
     static requestNewExpiredAccountEmail() {
        const homeserverUrl = MatrixClientPeg.get().getHomeserverUrl();
        const accessToken = MatrixClientPeg.get().getAccessToken();
        const url = `${homeserverUrl}/_matrix/client/unstable/account_validity/send_mail`;
        const options = {https://github.com/matrix-org/synapse-email-account-validity
            method: 'POST',
            headers: {
                Authorization: `Bearer ${accessToken}`,
            },
        };

        fetch(url, options);
    }
}

(source https://github.com/tchapgouv/matrix-react-sdk-v3/blob/develop/src/components/structures/MatrixChat.tsx#L1328-L1342 )

Other tasks :

We can modularize as module called "matrix-react-email-account-validity", it would be nice (I could be a generic plugin that work with https://github.com/matrix-org/synapse-email-account-validity).

@jdauphant jdauphant changed the title As an user, in case my account is deactivated, I want to be informed and have a process to reactivate my account As an user, in case my account have expirated, I want to be informed and have a process to reactivate my account Jul 25, 2022
@giomfo
Copy link

giomfo commented Aug 4, 2022

Let's try à beta without this. (if it's a blocker we'll reconsider)

I think this point is a blocker except if the beta testers are aware of this limitation (which need to be connected on another client which supports the account renewal)

@jdauphant jdauphant added the P2 Priority 2 label Sep 2, 2022
@odelcroi odelcroi added P1 Priority 1 and removed P2 Priority 2 labels Nov 9, 2022
@odelcroi odelcroi self-assigned this Nov 9, 2022
@odelcroi
Copy link
Member

We can modularize as module called "matrix-react-email-account-validity", it would be nice (I could be a generic plugin that work with https://github.com/matrix-org/synapse-email-account-validity).
I like the idea, it can be an open source contribution.
What do you have in mind to build such "plugin" ? I'm not sure element web have a mecanism to integrate frontend plugin? -> any ideas @weeman1337 ?

I thought of :

  • npm module with a root component to import at app level that will listen to ORG_MATRIX_EXPIRED_ACCOUNT errors and the display panel.

@weeman1337
Copy link
Contributor

You could check if this https://github.com/matrix-org/matrix-react-sdk-module-api provides an API that enabled you doing what you want. After a quick read opening dialogs should be possible.

If not you could „npm module with a root component to import at app level that will listen to ORG_MATRIX_EXPIRED_ACCOUNT errors and the display panel.“ give a try.

@odelcroi
Copy link
Member

odelcroi commented Nov 14, 2022

analysis

After a deeper analysis, this is what we need :
1 - Detect error 403 with the code ORG_MATRIX_EXPIRED_ACCOUNT in tchap app lifecycle,
- suspend the client synchronization
- trigger a process to renew account
- display a panel to inform users to renew the account
- disable any other interactions in the app
2 - Resume the client synchronisation and close the panel when account is not expired anymore

I'm considering 3 approaches for the integration (from less to most intrusive) :

  • create a module with the moduleAPI
  • create a non intrusive independant component
  • modify MatrixChat

solution

ORG_MATRIX_EXPIRED_ACCOUNT errors can be detected by listening to the events ClientEvent.Sync as proposed by @jdauphant.

  • what about login and other API calls?

Panels can be opened with the moduleAPI as mentionned by @weeman1337

How can we suspend/resume the client synchronisation?

  • from the moduleAPI ? still searching
  • from an external component? still searching
  • modifying MatrixChat : ok

How can we disable any other interactions in the app?

  • from the moduleAPI ? still searching
  • from an external component? still searching
  • modifying MatrixChat : ok

@jdauphant
Copy link
Contributor Author

Can you just block the UI interaction with an overlay and force reload the app after the validation ?

@estellecomment
Copy link
Contributor

It would be nice for the user to get a visual confimation in tchap-web that the account is successfully renewed. They should see "You have successfully renewed your account" somewhere in the app. If we just reload/resume silently, it may not be clear to the user what happened.

(but maybe first we should get the principle working, and think about UX after :) )

@odelcroi
Copy link
Member

odelcroi commented Nov 16, 2022

Test cases

  • account is expired, user is logged off, user login, the expiration panel is displayed after logging in
  • account is not expired, user is logged in, the expiration panel is displayed as soon as the account is expired
  • expired panel is open, user requests new email
  • expired panel is open, user requests second email before 30 seconds
  • expired panel is open, user requests new email, but sending fails (hard to test in dev...)
  • expired panel is open, user clicks on 'ok' button before clicking on the email link
  • expired panel is open, user cliks on email link, user clicks on 'ok' button

@odelcroi odelcroi linked a pull request Nov 16, 2022 that will close this issue
@odelcroi
Copy link
Member

POST requests to expire/renew account (usefull for testing)

#disable account
curl --location --request POST 'https://matrix.agent1.tchap.incubateur.net/_synapse/admin/v1/account_validity/validity' \
--header 'Authorization: Bearer <ADMIN_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "user_id": "<matrixID-of-user>",
    "expiration_ts": 1,
    "enable_renewal_emails": true
}'

#renew account
curl --location --request POST 'https://matrix.agent1.tchap.incubateur.net/_synapse/admin/v1/account_validity/validity' \
--header 'Authorization: Bearer <ADMIN_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "user_id": "<matrixID-of-user>",
    "expiration_ts": 1699633609,
    "enable_renewal_emails": true
}'
``
`

MarcWadai added a commit that referenced this issue Oct 8, 2024
…9d90..892a9e658e8

892a9e658e8 Merge pull request #11 from tchapgouv/upgrade-v3.112.0
7cf9e10e21d Fix merge conflict v3.112.0
ebd1e11d284 Merge tag 'v3.112.0' into upgrade-v3.112.0
933885386ed v3.112.0
e4ed18297cf Upgrade dependency to [email protected]
3687ee382dd test(sso): add test for email precheck, registration and welcome component
b32de09a709 v3.112.0-rc.0
08b3912de0f Upgrade dependency to [email protected]
dd405ea582d Merge remote-tracking branch 'origin/develop' into staging
f33e802 Fix untranslated keys being rendered in `/help` dialog (#90)
cd850f5be67 v3.111.0
059db4db1b8 Merge pull request #106 from element-hq/backport-95-to-staging
d30645f9084 Allow joining calls and video rooms without enabling the labs flags (#95)
39a0f6e Remove ts-ignores where no longer necessary (#89)
c10bc6c7168 feat(sso): add feature flag to active sso flow
36fae00 Change device isolation mode to set `errorOnVerifiedUserProblems` to `false` (#104)
33c900e Remove right panel toggling behaviour on room header buttons (#100)
81bb56a Simplify Jest runs in CI to share failures with merge queue (#103)
fe402e2 Fix flaky mobile registration tests (#102)
0b3b499 Fix label sync (#101)
bd793a0 Allow joining calls and video rooms without enabling the labs flags (#95)
4f39164 Ensure timeline search results are visible even in video rooms (#96)
f28f1d9 Improve error display for messages sent from insecure devices (#93)
be2c1fc Add labs option to exclude unverified devices (#92)
78cca0201a9 feat(sso): remove existing sso buttons
8962e8c Improve contrast for timestamps, date separators & spotlight trigger (#91)
ef9e310 Pop right panel timeline when unmaximising widget to avoid double timeline (#94)
fed6c34d440 feat(sso): add email domain precheck sso flow
81192f6 Update dependency typescript to v5.6.2 (#71)
34d1875 Open room settings on room header avatar click (#88)
3f67819 Merge pull request #41 from element-hq/t3chguy/wat/230.1
e6404da Update test assertions
9e4348e Update test assertions
dd7479a Merge branch 'develop' of github.com:element-hq/matrix-react-sdk into t3chguy/wat/230.1
ad94c39 Fix accessible label on left panel spotlight trigger (#87)
2e895da Crypto: fix display of device key (#86)
df9d81398ab v3.110.0
1d5d0cc835f Upgrade dependency to [email protected]
3c267f9 Update snapshots
3620c5a Merge branch 'develop' into t3chguy/wat/230.1
a1bdcee Update dependency @types/node to v18.19.50 (#65)
ef1d4f6 Grant Element Call widget capabilities for "raise hand" feature (#82)
47a9377 Update dependency @types/react to v17.0.82 (#66)
9aa09d4 Maybe fix flakey AddRemoveThreepid test (#81)
d56b9ed Update dependency eslint to v8.57.1 (#68)
a248788 Update peter-evans/create-pull-request digest to 5e91468 (#64)
1f55710 Mobile registration optimizations and tests (#62)
4be5338 Update dependency @sentry/browser to v8.30.0 (#69)
b055908 Update dependency css-tree to v3 (#74)
d4c942d Update playwright monorepo to v1.47.1 (#73)
ed7e02a Update dependency stylelint-scss to v6.6.0 (#70)
5058d66 Update Sibz/github-status-action digest to faaa4d9 (#63)
cf8fe20 Update dependency express to v4.20.0 [SECURITY] (#26)
fe65702 Update to use non deprecated methods to decode recovery key (#54)
490746e Update to use non deprecated methods to derive key from passphrase (#55)
73843e5fe6b v3.110.0-rc.1
4776f87 Ignore chat effect when older than 48h (#48)
0cc0ebe Replace old reference of `matrix-org/matrix-react-sdk` by `element-hq/matrix-react-sdk` (#60)
3dd223c Also add NPM_TOKEN (#57)
1e76313 Playwright: factor out some common code (#49)
154bf33 Manually clear orphaned recaptcha challenge overlay in android webviews (#53)
d04d611f1e8 v3.110.0-rc.0
0bbed85 Pass bot token through explicitly (#56)
6eb332f26d5 Upgrade dependency to [email protected]
49d84a6b0f9 Merge remote-tracking branch 'origin/develop' into staging
7feb5a0 Merge branch 'develop' into t3chguy/wat/230.1
13e67ae Add Release announcement for the pinning message list (#46)
1058af6 Playwright test for E2E messages from deleted devices (#47)
78ac691f50b feat(settings): remove generalusersettingtab and use accountusersetting tabs, hide personal info
c24661f [create-pull-request] automated change (#45)
5985277 Unlabs feature pinning (#22)
74885c9 Merge pull request #42 from element-hq/langleyd/mobile_registeration
20a4f0a Enforce config setting
3d89fc3 Merge branch 'develop' of https://github.com/element-hq/matrix-react-sdk into langleyd/mobile_registeration
62d66f9 Remove accidental paste
0716434 Allow hs_url as param on mobile_register
a89f61a Add error text and title with server name
9426fec Fix timeout type (#40)
be59791 Add support for `org.matrix.cross_signing_reset` UIA stage flow (#34)
8044ce4 Fix tests
b505828 update test to work with newer Rust crypto (#32)
0244aae use window.dispatchEvent
a6dec86 Add mobile registration and dispatch event for mobile postmessage dance
a6e98b0 Use `strong` over `b` for improved a11y semantics
6b384fe Fix huge usage bandwidth and performance issue of pinned message banner. (#37)
5740bdb [create-pull-request] automated change (#39)
0e8cd5b [create-pull-request] automated change (#38)
eae9d9e Add timezone to user profile (#20)
f317763 Reverse pinned message list (#19)
85b4f17 [create-pull-request] automated change (#33)
a701e3a Add config option to force verification (#29)
75918f5 Reduce pinned message banner size (#28)
433c14e Log clearer errors when picklekey goes missing (#27)
d337fba Add labels file (#21)
03004a5 Change settings to true by default (#25)
07125f5 Remove release announcement of new header (#23)
ccb1a61 [create-pull-request] automated change (#24)
51495e7 Remove pinned message list screenshot which are flacky (#17)
24fe2f2 [create-pull-request] automated change (#18)
491f0cd Change license (#13)
4382c67 Change org to element-hq (#7)
461da98 Merge pull request #10 from element-hq/dbkr/changelog_repos
e8c0b65 Merge branch 'develop' into dbkr/changelog_repos
6dd67b3 Merge pull request #11 from element-hq/dbkr/update_org_sonar
c26ce7a Merge branch 'develop' into dbkr/changelog_repos
3a42d2a Merge branch 'develop' into dbkr/update_org_sonar
d4771dd Merge pull request #3 from element-hq/dbkr/codeowners
58331fb Merge pull request #15 from element-hq/actions/localazy-download
0acc7dd [create-pull-request] automated change
272fd75 remove meangingless change
9fb871c poke the CI
caa6f26 Merge pull request #14 from element-hq/actions/playwright-image-updates
92b3eb5 [create-pull-request] automated change
deeeffa Update project key too
35f96b4 Update GH org in the sonar config file
9601be5 Update tests
f8da257 Update repos for changelog fetching
774222f Update codeowners to element-hq teams
78059e1 Merge pull request #1 from element-hq/actions/playwright-image-updates
eb14223 [create-pull-request] automated change
33791ca Merge pull request #12965 from matrix-org/florianduros/pinned-messages/analytics-event
08d1b6c Add analytics event for pinned messages
bce710e Upgrade `@matrix-org/analytics-events` to `0.25.0`
5bfbca9 Migrate all pinning checks and actions into `PinningUtils` (#12964)
2639923 Update browserslist (#12953)
6490742 Log phases in the verification process (#12963)
cdffbdb Add error handling for room publish toggle (#12941)
1e3320d Pinned message list: prevent sender name to overflow pinned event tile (#12947)
ab1e28b Compute with of content of pinned event tile (#12951)
60fe70b Add a prefix to file, poll, image, video and audio in the pinned message banner (#12950)
9d8c5b6 Update dependency @testing-library/jest-dom to v6.5.0 (#12957)
dbc8c9f Update peter-evans/create-pull-request action to v7 (#12960)
33404e4 Update stylelint (#12958)
df82c8a Update dependency @sentry/browser to v8.27.0 (#12956)
892b297 Update babel monorepo (#12955)
4769985 Update dependency @types/node to v18.19.47 (#12954)
8f22eb64432 v3.109.0-rc.0
9c233ef5db3 Upgrade dependency to [email protected]
6bfdb3e Fix read receipt animation (#12923)
5ff3fd6 [create-pull-request] automated change (#12949)
579cb6b Update to 2.37.9 (#12943)
f033b64 Display the indicator even with one message in pinned message banner (#12946)
41686bb Always display last pinned message on the banner (#12945)
1ac533e Don't emit decrypted event for the banner (#12944)
ae15bbe Allow user to set timezone (#12775)
acc7342 [create-pull-request] automated change (#12942)
3d41f5b [create-pull-request] automated change (#12938)
13ec19c Sort the pinning message list in the same order than the banner (#12937)
19f8b44 Implement download_file in widget driver (#12931)
2a450c0 Add `allowImportingTsExtensions` to tsconfig (#12939)
d16ab09 Display pinned messages on a banner at the top of a room (#12917)
8b2ded8 [create-pull-request] automated change (#12935)
6fb8f6e Update all non-major dependencies (#12909)
c6922c9 Fix reply message truncation on 2 lines (#12929)
ea3c5cf Fix pin/unpin slowness and non refresh from the message action bar (#12934)
43941ef Install deja-vu font in docker image (#12932)
71c31bb [create-pull-request] automated change (#12926)
8421022 Rename all the slow reporter stuff to cjs (#12933)
5b91dd8 Reset matrix-js-sdk back to develop branch
e66807e Merge branch 'master' into develop
30f84cd Update playwright image (#12930)
f0a75d8 Add a config option to control the default widget container height (#12893)
e599428 Ignore desktop for minimum browser support. (#12928)
1b70b22 Update typescript-eslint monorepo to v7.18.0 (#12924)
8381e13 Update stylelint (#12922)
5a9d7ba Remove unused CryptoCallbacks implementations (#12919)
69da175 Update babel monorepo (#12920)
0848237 Update dependency @types/sanitize-html to v2.13.0 (#12921)
135d94c Update playwright monorepo to v1.46.1 (#12918)
670ed81 Update dependency @sentry/browser to v8.26.0 (#12915)
35fb068 Update dependency axe-core to v4.10.0 (#12916)
9671545 Update dependency eslint-plugin-unicorn to v55 (#12913)
5e56ce7 Update dependency husky to v9 (#12914)
70665d3 RTE drafts (#12674)
fdc5acd Update dependency @types/react-transition-group to v4.4.11 (#12912)
72d5659 Update dependency @types/node to v18.19.44 (#12911)
2768b9c Set entrypoints to use ./lib rather than ./src (#12906)
a7e907e Add thread information in pinned message list (#12902)
3d80eff Add Pin/Unpin action in quick access of the message action bar (#12897)
4064db1 [create-pull-request] automated change (#12907)
933a9c1 Rename prettier config file to .cjs (#12903)

git-subtree-dir: linked-dependencies/matrix-react-sdk
git-subtree-split: 892a9e658e8a3f6fd225d2104b0e5001cd12ad7f
MarcWadai pushed a commit that referenced this issue Dec 2, 2024
* Open room settings on room header avatar click

Signed-off-by: Michael Telatynski <[email protected]>

* Fix nested interactive elements aria fail

Signed-off-by: Michael Telatynski <[email protected]>

* Update things for a11y and update snapshots

Signed-off-by: Michael Telatynski <[email protected]>

* Fix tests

Signed-off-by: Michael Telatynski <[email protected]>

* Iterate tests

Signed-off-by: Michael Telatynski <[email protected]>

---------

Signed-off-by: Michael Telatynski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P1 Priority 1 web
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants