Skip to content

Conversation

@microbit-robert
Copy link

Rename shortId to shareId

Closes #625

@github-actions
Copy link

Preview build will be at
https://review-createai.microbit.org/share-id-support/

src/App.tsx Outdated
throw "Not a shared key";
if (
!params.shareId ||
!/^(_[a-zA-Z\d]{12})|(S(?:\d{5}-){3}\d{5})$/.test(params.shareId)
Copy link
Author

Choose a reason for hiding this comment

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

This could be pulled out as a utility and have tests?

We don't have access to the backend code that produces these two type of ids to confirm that there is no additional variation we should cater for. Prefix of "_" is produced from users not logged in, prefix of "S" is from users who are logged in.


test("error", async ({ openSharedProjectPage }) => {
await openSharedProjectPage.goto("_aBadSh0rt1d");
await openSharedProjectPage.goto("_aaBadSh0rt1d");
Copy link
Author

Choose a reason for hiding this comment

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

Having had to update this to have the right number of characters, is it better to show a not found page when this is not valid, or better to show the potentially more helpful error case when the user has mis-copied an id?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Share links from logged in MakeCode users cannot be adapted to open in CreateAI

2 participants