Repository navigation
api: optional prefix param on the four marketplace listings - #17
Merged
Merged
Conversation
The node gained an optional trailing argument on these read methods (viz-cpp-node steemit#160) that is matched against an index, so a filter can reach rows the caller never paged to. Documented here in all three places the explorer and the lib read from: the method tree in src/api/methods.js, its copy plus the SPEC block in api-frontend/app.js, and the canonical jsonrpc-api-spec.json. Empty or omitted keeps the old behaviour, and an empty value is not sent at all by the explorer, so nothing changes for a caller that ignores it. One caveat worth knowing before the next release: the generated wrappers read the callback from a FIXED position (args[params.length]), so adding a param is breaking for POSITIONAL callers -- getPaidSubscriptions(0,100,cb) would hand cb over as the prefix. Callers using the *With(options, cb) form are unaffected (an absent option becomes null, which the node treats as an empty prefix). Nothing in Forecaster-client or WebVIZWallet calls these four positionally, so the break only reaches external consumers, and only when a release is cut -- which is a separate, deliberate step.
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.
The node gained an optional trailing argument on these four read methods (viz-cpp-node steemit#160) that is matched against an index, so a filter can reach rows the caller never paged to. The API explorer advertised the old signatures.
Documented in all three places the explorer and the lib read from:
src/api/methods.js— the method tree the lib generates its wrappers fromapi-frontend/app.js— its copy of that tree plus the SPEC descriptionsapi-frontend/jsonrpc-api-spec.json— the canonical specdatabase_api.get_accounts_on_salename_prefixdatabase_api.get_accounts_on_auctionname_prefixdatabase_api.get_subaccounts_on_salename_prefixpaid_subscription_api.get_paid_subscriptionscreator_prefixEmpty or omitted keeps the old behaviour, and the explorer does not send an empty value at all, so nothing changes for a caller that ignores the argument.
Before the next release
The generated wrappers read the callback from a fixed position (
args[params.length]), so adding a param is breaking for positional callers —getPaidSubscriptions(0, 100, cb)would handcbover as the prefix. Callers using the*With(options, cb)form are unaffected: an absent option serialises tonull, which the node treats as an empty prefix (verified on mainnet).Nothing in Forecaster-client or WebVIZWallet calls these four positionally, so the break only reaches external npm consumers, and only when a release is cut — which is a separate, deliberate step (npm publish is irreversible). Flagging it here so that step is not taken blind.
Live
api.viz.worldalready serves thisapp.js, and the explorer was driven end-to-end against mainnet: withname_prefixempty the first page ispress, liveblogs, russia, finance, bitcoin; withpreit ispressalone.Follows steemit#160, which shipped code-only.