Enable RU tests#9576
Conversation
Copilot PR ReviewIteration 1 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@186d8a131465475c79244d994acb872cd5c0d4bf Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 1 knowledge-backed · 1 agent findings. Orchestrator pre-filter (2 file(s) excluded)
Findings produced by the AL review agent v1.7.3. Reply 👎 on any inline comment to flag false positives. |
| // manual subscribers) because many RU report test codeunits rely on this behavior; a static | ||
| // subscriber is allowed here because this is not a test codeunit (AL0501 only applies to those). | ||
|
|
||
| [EventSubscriber(ObjectType::Codeunit, Codeunit::"File Management", 'OnBeforeDownloadHandler', '', false, false)] |
There was a problem hiding this comment.
RUReportDownloadHandler (codeunit 147210) is a static [EventSubscriber] on File Management.OnBeforeDownloadHandler that is always bound and fires for every download in every session that loads this test app, not just the RU report-validation tests it was written for. The knowledge article's anti-pattern is exactly this shape: an always-on side effect (here, silently copying a server file to the target path and forcing IsHandled := true) implemented as a static subscriber when the behavior is inherently scoped to specific tests. Any other test in the same app that triggers a client-side download will silently hit this handler too, which can mask genuine download failures or change behavior the test did not expect. The article recommends EventSubscriberInstance = Manual with BindSubscription/UnbindSubscription scoped to the tests that need it instead of a session-wide static subscriber.
Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
Enables RU tests.
AB#642528
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
Risk & compatibility