Skip to content

Fix control add-in registration on Linux package paths - #217

Merged
StefanMaron merged 1 commit into
aldevtools:masterfrom
artkashin:codex/fix-controladdin-registration
Nov 8, 2026
Merged

StefanMaron merged 1 commit into
aldevtools:masterfrom
artkashin:codex/fix-controladdin-registration

Conversation

@artkashin

Copy link
Copy Markdown
Contributor

Installing an app with JavaScript control add-ins can return HTTP 200 without registering any controls. The web client then reports that the control is not permitted. ReadDirectoryFilePaths compares Path.GetDirectoryName(file).Trim('\\') with addin; on Linux the remaining /addin never matches.

Fixes #216.

This adds a narrow Cecil patch to the package reader's directory predicate. It normalizes package/URI separators while preserving the existing comparison and leaving ordinary filesystem lookups unchanged. The same predicate serves perm, serv, replay and profile. The patch runs before NST loads CodeAnalysis, independently of BC_WINDOWS_TEXT, and stops startup if the expected single lookup cannot be found. Applying it twice does not rewrite the assembly.

The new AL smoke guard checks the existing fixture control's tenant registration, category and token. It is included in both branches of the BC version matrix. A separate Windows/Linux job covers 13 package-path cases, including nested resource exclusion.

Validation

Local runtime checks used BC 27.5.46862.52969 US, fresh stock artifact databases and empty service/assembly caches. The local image layered the rebuilt .NET 8 patcher and updated entrypoint on published runner digest 367941d8884b88e0cd8b5fa7eaac376cf33d2ad07bc4b6a9c45ce3bc5938eb7d.

  • Before: focused AL fixture, codeunits 70000|70051|70080, upstream WebSocket runner: 4 total, 3 passed, 1 failed. The new registration test expected 1 and found 0; the existing add-in-not-instantiated test passed.
  • After: identical focused AL fixture and runner: 4 total, 4 passed, 0 failed. Nonzero JUnit reports were produced for both runs.
  • Package-path cases: 13/13 on Windows and 13/13 in the Linux runner.
  • Actual CodeAnalysis patch: one lookup replaced; second application byte-identical. An unrelated assembly returns exit 1 without writing output.
  • The unchanged minimal package from BC 27.5: control add-ins install without registration on Linux (package path separator) #216 publishes successfully, now creates one tenant registration with a resource blob, and the real patched package reader returns its docket and ZIP.
  • Authenticated browser check with a minimal Scripts + StartupScript fixture: “Control add-in registered and running”, after JS → AL → JS. The callable function was moved into Scripts because functions declared inside StartupScript are scoped locally; this is a correction to the browser fixture, separate from the registration defect.
  • bash -n, workflow YAML parsing and git diff --check passed.

The local AL run compiled a focused subset of smoke fixtures; it was not a full smoke-suite run. BC 28/29 runtime validation has not been performed locally; the updated version matrix is configured to run the new guard on those legs.

@BrandonFreeman-Cavallo

Copy link
Copy Markdown
Contributor

Tested on BC 28.5 (28.5.54151.55994, US sandbox), which the PR notes hadn't covered.

Setup: published runner bc-runner@sha256:82641bc3… with this branch's patcher (2f5c9d5) layered on, plus the PR's packagepaths entrypoint step. Clean database, then several third-party extensions with JavaScript control add-ins installed through the dev endpoint.

  • The entrypoint logs Rewrote 1 package directory lookup in Microsoft.Dynamics.Nav.CodeAnalysis.dll (issue #216).
  • Before: NAV App Tenant Add-In only had the rows already in the restored database (System Application, E-Document Core). None of the installed extensions had any.
  • After: every installed extension's add-ins registered, 8 across four extensions.
  • In the web client, a page that failed with <add-in>;PublicKeyToken=…, The page contains a control add-in that is not permitted now renders its add-in. The JS → AL round trip completes: the add-in calls back into AL on a timer, and the page closes itself when AL is done.

@StefanMaron
StefanMaron merged commit 7ee6cd5 into aldevtools:master Nov 8, 2026
8 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BC 27.5: control add-ins install without registration on Linux (package path separator)

3 participants