refactor: quick-win cleanup — panic stubs, SaveToFile, dead code, error handling, syncWriter#4
refactor: quick-win cleanup — panic stubs, SaveToFile, dead code, error handling, syncWriter#4
Conversation
There was a problem hiding this comment.
Pull request overview
Cleanup-focused refactor that hardens error handling, removes dead code, replaces panic stubs with real implementations, and addresses background catalog update propagation/concurrency in the executor/catalog paths.
Changes:
- Propagate/record previously-discarded errors (including
_Transactionupdate in MPR v2 writes and widget insert failures) and add warning logs where appropriate. - Fix background catalog propagation by adding
SyncCatalogcallback +catalogMuprotection, and add a synchronized writer wrapper for background output. - Remove unused hashing helpers/tests and harden
Catalog.SaveToFileby escaping single quotes forVACUUM INTO.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/mpr/writer_units.go | updateTransactionID() now returns error and is propagated at call sites. |
| sdk/mpr/utils.go | Removes unused Hash wrapper. |
| mdl/types/id.go | Removes unused types.Hash implementation. |
| mdl/types/id_test.go | Removes tests for deleted Hash. |
| mdl/executor/executor_dispatch.go | Adds catalogMu usage and SyncCatalog callback wiring; documents cancellation behavior. |
| mdl/executor/executor.go | Adds catalogMu field to protect background catalog updates. |
| mdl/executor/exec_context.go | Adds SyncCatalog hook; unexports ensureSqlMgr. |
| mdl/executor/cmd_sql.go | Updates to call ctx.ensureSqlMgr(). |
| mdl/executor/cmd_pages_builder_v3.go | Logs warnings instead of discarding lookup errors. |
| mdl/executor/cmd_page_wireframe.go | Logs warning if describePage fails instead of silently discarding error. |
| mdl/executor/cmd_microflows_builder_calls.go | Logs warning if Java action lookup fails instead of discarding error. |
| mdl/executor/cmd_catalog.go | Adds syncWriter, background catalog propagation via SyncCatalog, and warns on writeResult failure. |
| mdl/catalog/catalog.go | Removes unused destination DB open; escapes quotes in path for VACUUM INTO. |
| mdl/catalog/builder_pages.go | Propagates widget insert errors instead of discarding; wraps with context. |
| mdl/backend/mpr/backend.go | Replaces panicking serialization stubs with delegation to existing mpr.Serialize* functions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 90 out of 103 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 20 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 20 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…or handling, syncWriter
|
Superseded by upstream PR mendixlabs#287 |
Why
The executor and SDK layers have accumulated several code hygiene issues during rapid feature development: panicking stubs that crash at runtime instead of delegating to existing implementations, silently discarded errors that hide data corruption and debugging signals, a background catalog build that never propagates results back to the main executor, a SQL injection vector in
SaveToFile, and dead code that adds maintenance burden. This PR addresses all of these as a zero-feature-change cleanup, reducing the risk surface before the upcoming nanoflow and WASM work.What
SerializeWidget/ClientAction/WorkflowActivitystubs now delegate to existingmpr.Serialize*free functions instead of panickingdestDBopentypes.Hash+mpr.Hash(zero callers, weak positional checksum)SyncCatalogcallback withsync.RWMutexprotection soREFRESH CATALOG BACKGROUNDresults are visible to subsequent commands; close old catalog on replacementsyncWriter(mutex-wrappedio.Writer) prevents interleaved output between background goroutine and main dispatch loopupdateTransactionIDreturns error,widgetStmt.Execpropagates, 4 sites get log-and-continue warningsEnsureSqlMgr, document syncBack cancellation behaviorVerification
make build && make test && make lint-gopasses