a0b32b4e - Say why a completed order may fall back to its creation date - #1209
Merged
Conversation
The fallback inside the completed branch covers a single case - an order completed before the valuta column existed - and the comment did not name it, which is the one thing a reader would want to know there.
The previous wording claimed a historical data gap that never existed: the migration adding the column backfilled every Completed row, and production holds none without a valuta. What the fallback actually guards is the invariant itself.
Saying it guards the invariant overstated it: the fallback does not repair a completed order without a valuta, it hides the anomaly behind a less precise date. That is defensible in a rendered row and not where interest is computed - the backend raises the same case there - and the comment now says so instead of implying protection it does not provide.
Collaborator
Author
|
Three review passes to get one comment right. Both discarded versions stated something untrue:
The wording now names the trade instead of implying protection, and points at the contrast in the backend, where the same anomaly is raised rather than worked around. No behaviour changed at any point — the diff touches comment lines only. |
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.
Follow-up to #1207 (merged), closing the last open review point from it.
formatTimestampreads the valuta timestamp only while the order is completed, and falls back to the creation date inside that branch. The comment explained why the valuta is tied to the completed state, but said nothing about why that fallback exists — and under the rule that a fallback carries its justification in the code, that is the one thing missing.Getting that justification right took three attempts, and both discarded ones were wrong in a way worth recording:
Completedrow fromupdated, and production holds 189 completed orders, none without a valuta.The comment now says that plainly, and why hiding it is the right trade in a rendered row and not where money depends on it —
accrueTranche()in the backend raises the same anomaly rather than working around it.Comment only, no behaviour change: across all three commits the diff touches nothing but comment lines.