fix: manifest loading on 52 char domain without TX ID#751
Open
speeddragon wants to merge 5 commits intoimpr/gunfrom
Open
fix: manifest loading on 52 char domain without TX ID#751speeddragon wants to merge 5 commits intoimpr/gunfrom
speeddragon wants to merge 5 commits intoimpr/gunfrom
Conversation
d1ad7ca to
2611098
Compare
Collaborator
Author
|
Failed: 3. Skipped: 0. Passed: 3008. Flaky tests:
|
src/dev_name.erl
Outdated
|
|
||
| %% @doc Try to resolve 52char subdomain back to its original TX ID | ||
| resolve_52char(Key, HookMsg, Opts) when byte_size(Key) == 52 -> | ||
| TXID = subdomain_to_tx_id(Key), |
Collaborator
There was a problem hiding this comment.
Convention is TXID not tx_id
src/dev_name.erl
Outdated
| Resolvers = hb_opts:get(name_resolvers, [], Opts), | ||
| ?event({resolvers, Resolvers}), | ||
| case match_resolver(Key, Resolvers, Opts) of | ||
| ArnsResolver = case match_resolver(Key, Resolvers, Opts) of |
Collaborator
There was a problem hiding this comment.
It isn't just Arns! ~name@1.0 is built to be agnostic
| resolve_52char(Key, HookMsg, Opts) when byte_size(Key) == 52 -> | ||
| TXID = subdomain_to_tx_id(Key), | ||
| %% Clean up entries that doesn't have <<"path">> as key or aren't IDs. | ||
| Body = lists:filter( |
Collaborator
There was a problem hiding this comment.
Please no waterfall.
src/dev_name.erl
Outdated
| hb_maps:merge(Base, Resolved, Opts). | ||
|
|
||
| subdomain_to_tx_id(Subdomain) when byte_size(Subdomain) == 52 -> | ||
| b64fast:encode(base32:decode(Subdomain)). |
Collaborator
There was a problem hiding this comment.
hb_util:human_id on the outer one
Collaborator
There was a problem hiding this comment.
Should keep the conversion consistent. Isn't this, for example b64 not b64u? Either way, better in a single codepath
src/hb_test_utils.erl
Outdated
| hb_util:human_int(Time * 1000) ++ "ms". | ||
|
|
||
| %% @doc Load ans104 binary files to a store. | ||
| load_and_store(Store, File) -> |
Collaborator
There was a problem hiding this comment.
How about just calling this preload? As it gets the data from our test directory, which is kind of preloaded?
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.
Allow loading manifests and assets from a URL that doesn't have a TXID, or when it doesn't end with
/, making the browser request assets to the domain root.These will work now:
https://4nuojs5tw6xtfjbq47dqk6ak7n6tqyr3uxgemkq5z5vmunhxphya.arweave.net/42jky7O3rzKkMOfHBXgK-304YjulzEYqHc9qyjT3efAhttps://4nuojs5tw6xtfjbq47dqk6ak7n6tqyr3uxgemkq5z5vmunhxphya.arweave.net/This also returns 404 instead of HyperBuddy dashboard on a subdomain that doesn't belong to a valid ARNS or 52-character domains.