-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
State: Split post query fetching status from result mapping #3671
Conversation
a029ded
to
70ffb2e
Compare
Notably, now that a schema is included, one should also test that schema persistence behaves correctly for query results.
|
patternProperties: { | ||
// Queries are JSON strings, optionally prepended by a site ID. We can | ||
// assume that query strings contain no spaces, and only simple values. | ||
'^(\\d+:)?\\{("[^"]*":("[^"]*"|\\d+|true|false),?)*\\}$': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fun 😄 Since we don't parse this later I'm not sure if we need to be this strict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we don't parse this later I'm not sure if we need to be this strict.
My main concern is that there's a real possibility that we change the syntax of the keys. I suppose I could be a bit more lax about it, e.g. \{[^\}]*\}
instead of the more complete JSON validation I have here.
👍 Changes look great. I like how the tree is being simplified. I verified that testing instructions worked, and also tested that the editor still loads properly when post/items data is thrown out. 🚢 |
Also,
|
70ffb2e
to
a83c638
Compare
…tching State: Split post query fetching status from result mapping
Follow-up to #3487 (comment)
This pull request seeks to split the
posts.queries
state subtree, which currently tracks both fetching status and response results for a query, to separate subtrees (posts.queries
andpost.queryRequests
). Benefits include:Object.assign
).Testing instructions:
Verify that there are no regressions, particularly around the
<PostSelector />
component, and ensure that fetching status is properly tracked such to avoid unnecessary excessive requests.Repeat testing instructions from #2350.
Ensure Mocha tests pass by running
make test
fromclient/state/posts
.Verify state persistence behaves as expected. See #3671 (comment) .
Follow-up tasks:
posts.query
toposts.queryResults
posts.queriesLastPage
toposts.queryLastPage
/cc @gwwar