Fix raw key write issue#954
Draft
shyba wants to merge 2 commits into
Draft
Conversation
speeddragon
reviewed
Jun 9, 2026
Comment on lines
+136
to
+139
| write(Opts, #{ <<"write">> := {Path, Value}, <<"raw">> := true }, _NodeOpts) | ||
| when is_binary(Path) -> | ||
| % Opaque binary key (raw Arweave ID) written verbatim so a raw read matches. | ||
| write(Opts, Path, Value); |
Collaborator
There was a problem hiding this comment.
Write doesn't have the same structure as read and type. We also cannot write raw binary via HTTP API requests. Write uses all the key values to write into the store.
One option would be to set allow-raw-key in the store configuration, so we can avoid the hb_path:to_binary call when reading and writing, falling back to the old behaviour.
Another could be similar to this, maybe with another structure to confuse the usage of HTTP requests? Eg, write(Opts, {raw, Map}, Nodeopts), where Map can be multiple key values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With #882, key from
read,write, andtypeoperations callhb_path:to_binary/1(previously was callingto_path), breaking index operations forhb_store_arweave, since they use the native_id function (returns a 32 byte binary) of a TXID (43 byte string), which might contain the2Fbinary for the forward slash, the key separator for groups used byhb_path:to_binary/1function, breaking the behaviour of the index for these TXIDs.