E-Document: restore default file extension fallback in ExportDataStorage - #9851
E-Document: restore default file extension fallback in ExportDataStorage#9851Groenbech96 with Copilot wants to merge 4 commits into
Conversation
|
Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234' |
|
@copilot Fix the issues. |
Found it — the CI failures were caused by two unused |
Resolves 'Unit Tests (*) (IntegrationTests)' in Pull Request Build: "Function ExportDataStorageFallsBackToDefaultFileExtension Assert.IsTrue failed. Expected the exported file to fall back to the default file extension." ExportDataStorage called the AL built-in DownloadFromStream directly, which does not raise Codeunit "File Management"::OnBeforeDownloadFromStreamHandler. The test library "Library - File Mgt Handler" only subscribes to that event, so it never captured the file name and GetDownloadFromSreamToFileName() returned '' - making the new test fail regardless of whether the extension fallback works. Routing the download through FileManagement.DownloadFromStreamHandler keeps the same runtime behaviour (it calls DownloadFromStream) and makes the file name observable to the standard test hook. [bcapps-fix-loop attempt 1] Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
CI triage for run 30622841084 (attempt 2) — all 26 1. Real / change-related — fixed in d9d2d0f Root cause is the test hook, not the fallback logic. Fix: route the export through 2. Not this PR — needs a separate look
Both are unrelated to E-Documents and reproduce in all 26 country jobs. Run 30614237197 (07:51 UTC today) had 22/22 IntegrationTests green, and |
Exporting E-Document files for any format without a dedicated
OnBeforeExportDataStoragesubscriber (German XRechnung, PEPPOL BIS 3.0 DE, FR Peppol BIS 3.0, DK OIOUBL, ES Factura-E/Verifactu, APAC PINT A-NZ, W1 Data Exchange, custom formats) produced a downloaded file with no extension — a regression from scoping the PEPPOL.xmlsubscriber to only"PEPPOL BIS 3.0".Fix
E-Document Log.ExportDataStorage()now falls back toE-Document Service.GetDefaultFileExtension()when no subscriber has already set an extension on the file name afterOnBeforeExportDataStorageruns..xml, still overridable per-service viaOnAfterGetDefaultFileExtension.Test
.xml.