Fix Catalogue tab 500ing on first load, and declare rustler explicitly for mdex_native - #25
Merged
ddon merged 2 commits intoAug 22, 2026
Conversation
MDEX_NATIVE_BUILD=1 in this environment forces mdex_native to build its NIF from source (OTP 28 ships no precompiled build), which requires rustler itself, not just rustler_precompiled. mdex arrives here transitively through phoenix_kit; a clean checkout failed to compile without this. Same declaration phoenix_kit's own mix.exs already carries.
column_picker_available? and catalogue_column_catalog() were only computed in put_catalogue_columns/2, reached from the show/hide/update column-picker event handlers — never from handle_params. The template references @column_picker_available and @catalogue_column_catalog unconditionally whenever tab == "catalogue", so the very first render (the only way to reach those event handlers in the first place) raised KeyError before a user could ever trigger them. Found live: GET /admin/crm/companies/:uuid?tab=catalogue 500s on every company, confirmed via a real request through AndiWeb.Router against the live node — not something PR #75's soft-dependency fix touches, predates it (last touched in 97a086e).
Contributor
Author
|
Ran the full suite on this branch tip: 618 tests, 0 failures (9 individually skipped, unrelated to this PR). The Catalogue-tab fix is additionally covered by its own point test mentioned in the description (5/5 passing, included in the above). |
This was referenced Aug 22, 2026
ddon
added a commit
that referenced
this pull request
Aug 22, 2026
Lock the six nav_tabs strips and the Catalogue-tab KeyError with tests, normalize supplier uuids at process_supplier_row/4 so a raw Postgrex uuid cannot re-enter company metadata, and always release the catalogue-probe sandbox owner.
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.
Two independent fixes on top of upstream/main.
Fix Catalogue tab 500ing on first load for every company
column_picker_available?andcatalogue_column_catalog()were only computed input_catalogue_columns/2, reached from the show/hide/update column-picker event handlers — never fromhandle_params. The template references@column_picker_availableand@catalogue_column_catalogunconditionally whenevertab == "catalogue", so the very first render (the only way to reach those event handlers in the first place) raisedKeyErrorbefore a user could ever trigger them.Confirmed live:
GET /admin/crm/companies/:uuid?tab=catalogue500s on every company. Not something PR #75's soft-dependency fix touches; predates it (last touched in 97a086e). Covered by a point test, 5/5 passing.Declare rustler explicitly so mdex_native force-builds
MDEX_NATIVE_BUILD=1forcesmdex_nativeto build its NIF from source when no precompiled build exists for the running OTP (28 in our case), which requiresrustleritself, not justrustler_precompiled.mdexarrives here transitively throughphoenix_kit; a clean checkout fails to compile without this. Same declarationphoenix_kit's ownmix.exsalready carries.One fix, six repositories. Every module that pulls
mdextransitively throughphoenix_kitneeds the same one-line declaration, and each repository needs its own PR. Already merged: BeamLabEU/phoenix_kit_catalogue#77, BeamLabEU/phoenix_kit_billing#27. Still open: BeamLabEU/phoenix_kit_warehouse#20, BeamLabEU/phoenix_kit_entities#35, BeamLabEU/phoenix_kit_document_creator#42.Scope. This makes this repository build from a clean checkout under
MDEX_NATIVE_BUILD=1. It does not remove the need for a host application to declarerustleritself: optional dependencies of dependencies are never resolved, so whichever project is the root has to declare it.