Repository navigation
Commit each court's code deletes with its reload - #468
nonprofittechy wants to merge 1 commit into
Conversation
|
This one isn't necessary but it does make sense if we're adding another service that depends on syncing it. I could also just postpone the scheduled sync. |
BryceStevenWilley
left a comment
There was a problem hiding this comment.
Thanks for the find; committing the initial delete of all tables to update isn't an intended thing. IIRC, I think that committing each court individually in the middle happened after the initial implementation.
I'll make the commented change in the PR before merging.
| // Every court's tables are about to be emptied; drop their versions too, so no reader trusts a | ||
| // version whose rows aren't loaded yet. Each court gets its version back when it reloads. | ||
| cd.deleteFromTable("installedversion"); |
There was a problem hiding this comment.
Not every court's tables are about to be emptied, just the ones passed in. I'll move this to replaceAll, which is the only command that runs in the normal server lifetime (replaceSome being invoked directly is only a manual activity).
In general installedversion is one of those internal implementation details that shouldn't be exposed to things outside of the proxy server though, and was one of the issues I had with the approach in #469, so I'm not gonna make it perfect
814ac55 to
81cadeb
Compare
updateAll deleted every changed court's rows up front, and the first court's commit published all of those deletes. Until each later court reloaded, it showed its old installedversion with missing rows. A court whose policy request failed stayed empty until the next run. Delete each court's tables right before reloading it, so the delete, new rows, and new installedversion commit together. replaceAll/replaceSome empty every court's tables but kept their installed versions, so a court reloaded at the same Tyler version looked unchanged to anything keyed on versions. Drop installedversion first; each court gets its version back as it reloads, and courts that replaceSome doesn't reload are picked up by the next refresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
81cadeb to
a0d763a
Compare
Problem
CodeUpdater.updateAlldeletes the rows of every changed court up front, then reloads courts one at a time. The first court's commit also commits all of those deletes. Until each later court reloads, it has its oldinstalledversionbut no rows. That can take minutes during the nightly refresh.installedversionto tell whether a court changed sees "unchanged" for a court that is actually empty.replaceAll/replaceSomehave a similar problem. They empty every court's tables but keep each court'sinstalledversion. A court reloaded at the same Tyler version then looks unchanged.replaceSome Xempties every court but reloads only X, and the other courts keep their versions, sorefreshnever reloads them.Change
updateAll: delete each court's tables right before reloading it. The delete, the new rows and the newinstalledversionnow commit together.replaceSome: deleteinstalledversionfirst. Each court gets its version back as it reloads. Courts that aren't reloaded have no version, so the nextrefreshpicks them up.getVersionsToUpdatealready treats a missing version as "needs update".The timing and logging lines for the old up-front delete loop are gone.
Testing
Compiles, and spotless is clean. There's no automated test, because this path downloads from Tyler. It's worth watching the next nightly
refreshlogs after deploy.This came up while building #469, which relies on
installedversionmatching what's actually loaded. It's independent and can merge on its own.🤖 Generated with Claude Code