Ctrl+F5/F5 empties the rad.json of the project active when the publish finishes, not of the published project

オープン
#8,361 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
40/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
領域
devtools

調査の方向性

Start by tracing the publish completion flow in DebugAdapterLaunchBrowserRequestHandler and DebugAdapterLaunchRequestHandlerBase.PublishPackage, then compare it with BuildAndPublishHelper.EmptyRadContext(project). The issue identifies the wrong active project context as the cause; check the existing publish tests and add coverage for switching projects while a publish is running. Done means the published project's rad.json is emptied and the other project's file is unchanged.

索引モデルが issue の本文から書いたものです。

説明

1. Describe the bug

In a multi-root workspace, Ctrl+F5 and F5 empty the rad.json of the project that's active when the publish finishes, instead of the project they published. If another project's file is focused by then (e.g. to publish that project next, as a large app takes minutes to publish), that project's rad.json is emptied, and the published project's rad.json keeps listing every object changed in it. AL: Publish full dependency tree for active project doesn't have the problem: it empties the rad.json of each project it published.

Running tests from VS Code is hit hardest. The Test Explorer builds every project reference whose rad.json lists changes, then publishes every project it built, whatever dependencyPublishingOption says. So the next test run republishes the app that was just published (minutes for a large app) before running the tests, even with "dependencyPublishingOption": "Ignore".

2. To Reproduce

  1. Multi-root workspace with app A, app B that depends on A, and test app T that depends on A. Every launch configuration has "dependencyPublishingOption": "Ignore".
  2. Change an object in A, so A's .vscode/rad.json lists it.
  3. Focus A's app.json and press Ctrl+F5.
  4. While A is publishing, focus B's app.json.
  5. Wait until A's publish succeeds.
  6. Open A's and B's .vscode/rad.json.
  7. Run any test of T from the Test Explorer.

3. Expected behavior

  • Step 6: A's rad.json is empty, as A was published.
  • Step 7: only T is built and published.

4. Actual behavior

  • Step 6: B's rad.json is emptied, and A's still lists the changed objects.
  • Step 7: the Test Explorer rebuilds A and publishes it again before T. Ctrl+F5 of B or T also rebuilds A, though with Ignore it only publishes B or T.

The cause, from the 18.1 binaries:

  • DebugAdapterLaunchRequestHandlerBase.PublishPackage takes the project to publish from LanguageServerOptions.ProjectRoot when the publish starts.
  • Once the publish has succeeded, DebugAdapterLaunchBrowserRequestHandler calls EmptyThisAndPublishedPackagesRadFiles, which empties ObjectChangeDocumentManager.ActiveObjectChangeManager and VsCodeWorkspace.CurrentRadPath: the current project at that moment.
  • BuildAndPublishHelper.PublishProjectsAsync (used by the full dependency publish and the Test Explorer) calls EmptyRadContext(project) for each project it published, which is right.
  • RunTestRequestHandler calls BuildAndPublishHelper.BuildAndPublishProjectsAsync with forceBuildOfAllDependencies false, which publishes every project that BuildWorkspaceAsync built (GetSortedProjectsForSelectivePublish), so a project reference with a stale rad.json is republished.

We hit this on 21 Oct 2026: A (about 800 objects, several minutes to publish) was published successfully (the app in the sandbox matches the local source, file for file), but afterwards its rad.json still listed all 9 objects changed in it, and B's had been emptied.

5. Versions:

  • AL Language: 18.1.2842859
  • Visual Studio Code: 1.142.0
  • Business Central: 28.5 (online sandbox)
  • List of Visual Studio Code extensions that you have installed: AL Language, plus others that don't take part in publishing (e.g. GitHub Copilot Chat, ALCops). The cause above is in the AL Language extension's own code.
  • Operating System:
    • Windows
    • Linux
    • MacOS
Final Checklist
  • Search the issue repository to ensure you are reporting a new issue
  • Reproduce the issue after disabling all extensions except the AL Language extension
  • Simplify your code around the issue to better isolate the problem
主要言語
PowerShell
スター
891
フォーク
287
平均マージ
4時間 7分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/AL のほかの issue

microsoft/AL の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。