Repository navigation
Read a compact purchase count on Stock - #284
Merged
Merged
Conversation
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.
Stock purchase badge
Stock reads the purchase total with a direct SQLite count. A paired Client sends the revision of its last capture to the Host. The Host returns the total and, when needed, up to 50 recent purchases from the same read transaction. The Client saves those rows under the reviewed Host, library and target generation. Only the number crosses the desktop bridge on a successful compact read. Older Hosts use the existing purchase queue. Offline badges retain the saved-row count.
Verification
The browser regression opens Stock, checks the badge, and refreshes it after the order count changes. The paired TCP test creates an order through the inventory engine, observes the updated count, disconnects the Host and finds the order in the Client database. An additional database test covers an empty capture, an unchanged revision and the 50-row limit.
Measurements
Median of six alternating before/after production UI runs in Chromium. Opening is the click from Loans to Stock with an empty purchase cache. Refresh uses the visible retry button after an unrelated printer read failure, with an unchanged purchase revision. Time ends when the purchase read has returned and the correct badge is visible. Bytes sum JSON requests and successful replies on the desktop bridge through idle. The purchase commands use real SQLite and an authenticated loopback Host. Other domains use fixed test fixtures. Times depend on machine load.
Host-to-Client HTTP traffic is separate from the desktop bridge. At 10,000 orders, a cold compact read includes 50 rows on that link. An unchanged refresh carries only the total and revision.