Repository navigation
Refreshing a table after a column was removed no longer blocks other tables - #653
Merged
Merged
Conversation
…tables A missing row left undecided on a refresh carries over only the values of the columns the refreshed table keeps, with the same role. Copied whole, it kept a removed column's value, the stored table no longer matched its read-back, and the batch-wide round-trip gate refused the next refresh of every other table. Part of #619.
Deploying cozy-loop-studio with
|
| Latest commit: |
b949a26
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9d7ade63.cozy-loop-studio.pages.dev |
| Branch Preview URL: | https://refresh-undecided-row-remove.cozy-loop-studio.pages.dev |
5 of 6 tasks
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.
Part of #619 (item 3 only; items 4, 1 and 5 stay for their own scopes).
What was wrong
Data ▸ Refresh with a column confirmed as removed, while a row missing from the new data is left undecided (neither unlinked nor deleted, the wizard's default):
round-trip-mismatch("This data could not be stored safely"), however good its data.docs/data-import.md ("Column-level events") already says a removed column's prior values are dropped; the undecided branch of
buildRefreshCommitdid not follow it.The change
src/model/dataImportRefresh.ts: the undecided missing row carries over only the values under a column the refreshed table keeps, with the same role. Values under a kept column stay: they are the base of the Parameters still linked to the row.Tests (
src/model/dataImportRefresh.test.ts), written firstTables Items (key, name = label, weight and cost = number, cat = foreign key to Cats) and Cats; Parameters on both Items rows' weight and cost; the paste holds only
itm_b, soitm_ais missing and left undecided.itm_a, read-back, refresh of Catscol_weight: 10kept, read-back differs, Cats refused{ col_cost: 4 }, equal, Cats passescol_weight, reopened differs{ col_cost: 4 }, reopened equal, Cats passesOn main's code 4 of the 7 fail. The kept-cost test first failed on my own assertion: it expected the cost Parameter to be absent from the changed nodes, but its auto-composed label is recomputed. It now checks that the Parameter stays linked to cost with value 4. Run
A-unit-on-main-code.outis that first run, kept;A2is the rerun.The measurement before the fix (kept as run, with what was withdrawn)
The reproduction probe went through the store's own commit, Undo, the save writer and the reader.
fileHasStraytested the saved text with a regex that does not match the indented JSON, so itsfalsemeans nothing. Its other values stand and are the same in run 3.itm_aholdscol_weight: 10.Run 3 also measured:
Checks
npx tsc -b: clean.npm run lint: 88 warnings, the baseline.check:*scripts: pass.What it touches
Only the commit of a refresh with a removed column and an undecided missing row. A refresh without a removed column, an unlinked or deleted row, and every other path are unchanged.