Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Show a progress bar while migrating from legacy crypto #12104

Merged
merged 4 commits into from
Jan 17, 2024

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jan 3, 2024

Fixes element-hq/element-web#26773.
Requires matrix-org/matrix-js-sdk#3982

Screenshot:
image


Here's what your changelog entry will look like:

✨ Features

@richvdh richvdh added the T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements label Jan 3, 2024
@richvdh richvdh force-pushed the rav/element-r/migration/progress branch from 6a24076 to 835fc53 Compare January 3, 2024 16:51
Base automatically changed from rav/login_splash_screen to develop January 4, 2024 18:35
@pmaier1
Copy link

pmaier1 commented Jan 5, 2024

Proposal
Hang tight. We are updating Element to optimise your experience.

I think this should make it clear that it's a one-off.

@pmaier1
Copy link

pmaier1 commented Jan 8, 2024

Proposal2
Hang tight. We are updating Element to make encryption faster and more reliable.

@richvdh
Copy link
Member Author

richvdh commented Jan 10, 2024

Proposal2 Hang tight. We are updating Element to make encryption faster and more reliable.

Now updated

Copy link
Contributor

@andybalaam andybalaam left a comment

Choose a reason for hiding this comment

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

Looks good - a few minor comments and questions.

function getPickleAdditionalData(userId, deviceId) {
const additionalData = new Uint8Array(userId.length + deviceId.length + 1);
for (let i = 0; i < userId.length; i++) {
additionalData[i] = userId.charCodeAt(i);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is all the data ASCII? We appear to be looping through UTF-16 code units and inserting them into 8-bit character data.

Copy link
Member Author

Choose a reason for hiding this comment

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

For what it's worth, this whole method was a c&p from BasePlatform.ts. To answer this specific point: hopefully!

The data in question are a user ID and a device ID. The user ID is effectively made up by playwright; currently it is always @user:localhost. (Also, https://spec.matrix.org/v1.9/appendices/#user-identifiers mandates ascii for user IDs.)

The device ID is made up by the homeserver being used for the tests. They lack a grammar (matrix-org/matrix-spec#174), but Synapse always uses ASCII IDs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds OK then, but maybe worth a comment.

for (let i = 0; i < userId.length; i++) {
additionalData[i] = userId.charCodeAt(i);
}
additionalData[userId.length] = 124; // "|"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd marginally prefer "|".charCodeAt(0) but OK with this.

}
additionalData[userId.length] = 124; // "|"
for (let i = 0; i < deviceId.length; i++) {
additionalData[userId.length + 1 + i] = deviceId.charCodeAt(i);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be easier to concatenate the strings and then loop through one string?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, you'd think. I can only say again: this was cargo-culted.

yield decoded.charCodeAt(i);
}
};
const decoded = Uint8Array.from(itFunc());
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question about UTF-16 code units going into an 8-bit array.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, but I guess these are from a base64-encoded string, so they are guaranteed ASCII.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes. this bit was cargo-culted from decodeBase64 in the js-sdk.

@richvdh richvdh added this pull request to the merge queue Jan 17, 2024
Merged via the queue into develop with commit 993a702 Jan 17, 2024
22 checks passed
@richvdh richvdh deleted the rav/element-r/migration/progress branch January 17, 2024 07:37
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Feb 3, 2024
Weirdly, there is no 1.11.56, so it apparently was skipped?

Changes in [1.11.57](https://github.com/element-hq/element-web/releases/tag/v1.11.57) (2024-01-31)
==================================================================================================
## 🦖 Deprecations

* Deprecate welcome bot `welcome_user_id` support ([#26885](element-hq/element-web#26885)). Contributed by @t3chguy.

## ✨ Features

* Expose apps/widgets ([#12071](matrix-org/matrix-react-sdk#12071)). Contributed by @charlynguyen.
* Enable the rust-crypto labs button ([#12114](matrix-org/matrix-react-sdk#12114)). Contributed by @richvdh.
* Show a progress bar while migrating from legacy crypto ([#12104](matrix-org/matrix-react-sdk#12104)). Contributed by @richvdh.
* Update Twemoji to Jdecked v15.0.3 ([#12147](matrix-org/matrix-react-sdk#12147)). Contributed by @t3chguy.
* Change Quick Settings icon ([#12141](matrix-org/matrix-react-sdk#12141)). Contributed by @florianduros.
* Use Compound tooltips more widely ([#12128](matrix-org/matrix-react-sdk#12128)). Contributed by @t3chguy.

## 🐛 Bug Fixes

* Fix OIDC bugs due to amnesiac stores forgetting OIDC issuer \& other data ([#12166](matrix-org/matrix-react-sdk#12166)). Contributed by @t3chguy.
* Fix account management link for delegated auth OIDC setups ([#12144](matrix-org/matrix-react-sdk#12144)). Contributed by @t3chguy.
* Fix Safari IME support ([#11016](matrix-org/matrix-react-sdk#11016)). Contributed by @SuperKenVery.
* Fix Stickerpicker layout crossing multiple CSS stacking contexts ([#12127](matrix-org/matrix-react-sdk#12127)).
* Fix Stickerpicker layout crossing multiple CSS stacking contexts ([#12126](matrix-org/matrix-react-sdk#12126)). Contributed by @t3chguy.
* Fix 1F97A and 1F979 in Twemoji COLR font ([#12177](matrix-org/matrix-react-sdk#12177)).
## ✨ Features

* Expose apps/widgets ([#12071](matrix-org/matrix-react-sdk#12071)). Contributed by @charlynguyen.
* Enable the rust-crypto labs button ([#12114](matrix-org/matrix-react-sdk#12114)). Contributed by @richvdh.
* Show a progress bar while migrating from legacy crypto ([#12104](matrix-org/matrix-react-sdk#12104)). Contributed by @richvdh.
* Update Twemoji to Jdecked v15.0.3 ([#12147](matrix-org/matrix-react-sdk#12147)). Contributed by @t3chguy.
* Change Quick Settings icon ([#12141](matrix-org/matrix-react-sdk#12141)). Contributed by @florianduros.
* Use Compound tooltips more widely ([#12128](matrix-org/matrix-react-sdk#12128)). Contributed by @t3chguy.

## 🐛 Bug Fixes

* Fix OIDC bugs due to amnesiac stores forgetting OIDC issuer \& other data ([#12166](matrix-org/matrix-react-sdk#12166)). Contributed by @t3chguy.
* Fix account management link for delegated auth OIDC setups ([#12144](matrix-org/matrix-react-sdk#12144)). Contributed by @t3chguy.
* Fix Safari IME support ([#11016](matrix-org/matrix-react-sdk#11016)). Contributed by @SuperKenVery.
* Fix Stickerpicker layout crossing multiple CSS stacking contexts ([#12127](matrix-org/matrix-react-sdk#12127)).
* Fix Stickerpicker layout crossing multiple CSS stacking contexts ([#12126](matrix-org/matrix-react-sdk#12126)). Contributed by @t3chguy.
* Fix 1F97A and 1F979 in Twemoji COLR font ([#12177](matrix-org/matrix-react-sdk#12177)).
## ✨ Features

* Use jitsi-lobby in video channel (video rooms) ([#26879](element-hq/element-web#26879)). Contributed by @toger5.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Element-R: Progress display for migration to Rust crypto
3 participants