refactor(snapshots): drop ignored ?network= query param, rely on client filter#150
Open
Kewe63 wants to merge 1 commit into
Open
refactor(snapshots): drop ignored ?network= query param, rely on client filter#150Kewe63 wants to merge 1 commit into
Kewe63 wants to merge 1 commit into
Conversation
…nt filter The snapshot listing API at https://snapshots.arc.network/api/snapshots returns entries for every network regardless of the ?network= query parameter; the client has been filtering by network locally since the parameter was introduced. Carrying the parameter in the URL is therefore just noise, and worse, it implies a server-side contract that does not exist. Drop the parameter. Tighten the comment that justified it (it was a FIXME) to describe the client-side filter as the actual filter and flag the request URL as the only place that would need to change if the server ever starts honouring ?network=. Tests updated to match the new request shape: - 'fetch_latest_snapshot_urls_returns_correct_urls' no longer pins the server to a specific ?network= value, since the client no longer sends one. - 'fetch_latest_snapshot_urls_uses_devnet_network_param' was asserting that the client sent the param; renamed to 'fetch_latest_snapshot_urls_uses_devnet_listing' and reworked to assert the actual current contract — the devnet chain is selected correctly from a multi-network listing. - 'fetch_latest_snapshot_urls_filters_by_network_devnet' is a new symmetric test for the devnet filter, mirroring the existing testnet one.
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.
Summary
The snapshot listing API at
https://snapshots.arc.network/api/snapshotsreturns entries for every network regardless of the?network=query parameter — client-side filtering by network has been the actual behavior since the parameter was introduced. Carrying the parameter in the URL is noise and, worse, implies a server-side contract that does not exist.Fix
?network=from the request URL.FIXME) to accurately describe the client-side filter as the real filter, and flagged the request URL as the only place that would need to change if the server ever starts honouring?network=.Changes
File:
crates/arc-snapshots/src/download.rs?network=query parameter from request URL.Tests updated:
fetch_latest_snapshot_urls_returns_correct_urls?network=valuefetch_latest_snapshot_urls_uses_devnet_network_paramfetch_latest_snapshot_urls_uses_devnet_listing; reworked to assert the actual contract — devnet chain is selected correctly from a multi-network listingfetch_latest_snapshot_urls_filters_by_network_devnetHow to Test
Risk & Impact
None. The server never honored
?network=, so removing it from the request changes nothing at runtime. Client-side filtering behavior is unchanged. Tests now accurately reflect the actual contract.Type: ♻️ Refactor