fix: convert UUID to GUID blob in GetRawUnit for v1 MPRs#711
Open
densmoe wants to merge 1 commit into
Open
Conversation
…ixlabs#705) GetRawUnit passed the UUID string directly to SQLite for v1 MPR files, but UnitID is stored as a 16-byte GUID blob. The query never matched, returning "no rows" for every lookup on v1 projects (Mendix < 10.18). Apply types.UUIDToBlob() before querying, consistent with getUnitByIDV1() and GetRawUnitBytes() which already do this correctly. Includes regression test with a trimmed Mendix 9.24 v1 MPR fixture. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Closes #705
What does it do?
GetRawUnit()insdk/mpr/reader_documents.gopassed the UUID string directly to SQLite on v1 MPR files (Mendix < 10.18), butUnitIDis stored as a 16-byte GUID blob. The query never matched, silently returning "no rows" for every unit lookup.The fix adds
types.UUIDToBlob()before the query, consistent withgetUnitByIDV1()inreader_units.goandGetRawUnitBytes()inwriter_security.gowhich already have the correct implementation.Testing
go build ./sdk/mpr/— passesgo vet ./sdk/mpr/— passesgo test ./sdk/mpr/— all tests pass (including new regression test)TestGetRawUnit_V1) uses a trimmed Mendix 9.24 v1 MPR fixture and verifies all unit IDs returned byListAllUnitIDs()can be retrieved viaGetRawUnit()Mendix validation
N/A — this is a read-only code path, no BSON serialization changes.
Agentic Code Testing
N/A — this is a library-level bug fix, not an MDL command.
🤖 Generated with Claude Code