Skip to content

Conversation

@Byron
Copy link
Collaborator

@Byron Byron commented Aug 9, 2024

As a follow-up to #4657, this brings back previously reverted improvements and assures that BString will never be serialized as sequence of bytes, something the UI will not be able to interpret as string.

This PR will also put safeties in place to assure an over-eager future me does that again.

Tasks

  • revert previous quick-fix
  • assure gix-types with internal BString are serialized correctly
  • assure that bare BString cannot be mis-interpreted again
  • validate that the UI is indeed working

Notes

Previously I managed to not correctly communicate in code the BString serialization 'specialty' (it serializes as array of bytes), and managed to undo it in a refactoring step. Now this case is handled by its own type which would make it very hard for me or others to make the same mistake - now it's clearly communicate why the type exists.

It's also a nice marker that signals that the backend (which probably should be frontend agnostic eventually) is using frontend specific types in its API.

@vercel
Copy link

vercel bot commented Aug 9, 2024

@Byron is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the rust Pull requests that update Rust code label Aug 9, 2024
This reverts commit 3043f09.

We actually need this - me removing it just means it wasn't properly
documented and clarified in the type-system as to why this is needed.
…quence of numbers.

Instead, we need it to be a string, even if lossy.
@Byron Byron marked this pull request as ready for review August 9, 2024 11:18
@Byron Byron enabled auto-merge August 9, 2024 11:19
@Byron Byron requested a review from krlvi August 9, 2024 11:20
Copy link
Member

@krlvi krlvi left a comment

Choose a reason for hiding this comment

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

fixes it, thanks

@Byron Byron merged commit af6815d into gitbutlerapp:master Aug 9, 2024
@Byron Byron deleted the fixes branch August 9, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants