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

Update legacy blob refs in profile records #2488

Merged
merged 2 commits into from
May 14, 2024
Merged

Conversation

dholms
Copy link
Collaborator

@dholms dholms commented May 13, 2024

This is a relatively crude/ham-fisted fix intended to help with the fact that some accounts still have legacy blob refs in their profile records which is preventing them from updating their profile record.

Ended up landing this in putRecord instead of the prepareWrite functions because we need access to the actor store to find the size of the blob. We only implement it in putRecord when updating specifically a profile record in order to both reduce the number of checks we're required to do, but also because this issue is mostly isolated to historical profile records.

This is a stopgap until we have time to run a proper migration that updates all legacy blob refs.

record: ProfileRecord,
) => {
if (record.avatar && !record.avatar.original['$type']) {
const blob = await actorStore.repo.blob.getBlobMetadata(record.avatar.ref)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just double-checking that we like the behavior of throwing here if the blob is not found.

Copy link
Collaborator Author

@dholms dholms May 14, 2024

Choose a reason for hiding this comment

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

Yup think so

I believe that's the behavior we'd do you tried to update a record and were missing a blob anyways 👍

Copy link
Collaborator

@devinivy devinivy left a comment

Choose a reason for hiding this comment

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

Looking good 👍

@dholms dholms merged commit 290a7e6 into main May 14, 2024
10 checks passed
@dholms dholms deleted the profile-legacy-blob-refs branch May 14, 2024 17:05
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.

None yet

2 participants