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

reel: migrate old tokens and update link flow to match #284

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

arthyn
Copy link
Member

@arthyn arthyn commented Sep 16, 2024

OTT, we only migrated tokens in %bait, but we need to migrate them here in %reel so that both the old UI and the new UI can work.

@arthyn arthyn requested a review from Fang- September 16, 2024 15:18
Copy link
Member

@Fang- Fang- left a comment

Choose a reason for hiding this comment

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

I think this is good, on the condition that my comments check out.

?: =('' url)
~[[%give %fact ~[[%token-link (scot %p src.bowl) token ~]] %json !>(~)]]
~[[%give %fact ~[[%token-link (scot %p src.bowl) token ~]] %json !>(s+url)]]
=/ path (stab (cat 3 '/token-link/' token))
Copy link
Member

Choose a reason for hiding this comment

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

Some smell on this not being /token-link/(scot %t token), but iirc that's for backcompat reasons that are out of scope here, right?

Copy link
Member

Choose a reason for hiding this comment

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

(Also some of the cords in the surrounding code should probably be token:reels.)

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm this should be able to work I think

Copy link
Member Author

Choose a reason for hiding this comment

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

nvm we can't do this

Comment on lines +87 to +95
|= [[=token:reel =metadata:reel] [md=_our-metadata id=_stable-id]]
?^ (slaw %uv token) [md id]
?^ (rush token flag)
:- md
?: (~(has by id) token) id
(~(put by id) token token)
=/ new (rap 3 (scot %p our.bowl) '/' token ~)
:- (~(put by md) new metadata)
(~(put by id) new new)
Copy link
Member

Choose a reason for hiding this comment

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

This is fine to run on every load, because none of the transformations result in follow-up:

  • New-style tokens (@uv format) are untouched,
  • "New old-style" tokens (~ship/term format) only guarantee they have an entry in stable-id,
  • "Old old-style" tokens get upgraded into "new old-style" tokens and put an entry in stable-id.

Correct?

Copy link
Member

Choose a reason for hiding this comment

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

(I'd still feel more comfortable with migration moving into state version %5, fwiw, just because it doesn't even risk repeated transforms.)

Copy link
Member Author

Choose a reason for hiding this comment

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

yep!

@arthyn arthyn merged commit 6c6adca into develop Sep 16, 2024
1 check passed
@arthyn arthyn deleted the hm/migrate-old-tokens branch September 16, 2024 15:40
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.

2 participants