Repository navigation
fix(edits): keep pending edits, transactions and saved connections from being lost without asking - #4283
Merged
Conversation
…nd app work of a lost session once each, and keep connections.json readable record by record
…er Windows ends the app by force
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.
Summary
From #4268:
DataChangeManager) and their undo history. The window-wide manager swapped by snapshot is gone, withQueryTab.pendingChanges, the parked-edit bookkeeping and the selected-tab guards. A save, a result, an undo or a metadata answer acts on the tab it belongs to, whichever tab is selected.SETvalues, the report is no longer spent on whatever runs first. The next statement someone wrote (query tab, Run All, Explain, transaction bar, AI and MCP, AppleScript, Shortcuts) and the app's own next work on that session (grid save, import, structure, rename), which would have joined the lost transaction, are each refused once; neither uses up the other's. Reads are never refused. Work on a temporary table the session took is refused until it is created again.RegisterApplicationRestart, as Restart Manager's guidelines ask.From #4273:
connections.jsonandcredentialProfiles.jsondecode record by record. A record this build cannot read is written back as it was, or kept in<file>.unreadable-recordswhen the file changed outside TablePro, so a save never signs it. Each save keeps the previous file and its tag as<file>.backup, and a file that no longer parses is restored from it with the backup's own trust (an untagged backup stays untrusted on every later load).Tests changed on purpose:
ParkedEditSnapshotTests,PendingChangesSnapshotTests, thesaveState/restoreStatecases inDataChangeManagerExtendedTests, theTabChangeSnapshotcases inDataChangeModelsTests,UnloadedValueWriteTests.backgroundTabSnapshotTakesLoadedValue,MainContentCoordinatorTabSwitchTests.dataChangeManagerRestoresFromSnapshot.ResultReplacementEditsTestsandTabEditHistoryTestscover the behavior now.SaveAttributionTests(a save approved after a switch now writes the saving tab's edits),DataTabGridEditCommitTests(a commit from a tab the selection left lands in its own edits), fourMainContentCoordinatorTabSwitchTestscases,TabCloseProtectionTests,DataChangeManagerExtendedTests(redo kept bydescribeTable),SessionRecoveryLoopTests,SessionLanesTests(app work told once, then runs).MainContentCoordinator(...)call drops thechangeManager:argument.Docs: TableProApp/docs#239 (draft, merges after this).
Test plan
TabEditHistoryTests: undo after switching away and back, undo stays in its tab, a background result drops only its tab's edits (fail on main: the switch wiped the history).SessionRecoveryLoopTests,SessionLanesTests: app work after a loss runs and leaves the report for the next statement; temporary-table work refused while the loss stands.ConnectionStoreTagRemovalTests: unreadable record kept, backup kept, damaged file restored with its trust, untrusted unreadable records set aside.SessionRecoveryTests,TabRecoveryTests(model, run here),APendingEditComesBackAfterTheAppIsKilledEvenWithReopenOff(UI, CI).Closes #4268
Refs #4273