Repository navigation
Log a capture attachment that fails to download - #834
Merged
Merged
Conversation
…EADME rows PR #793 changed IRepositoryDirectory.Register to return Result<TasksRepositoryRef>; two doubles in Backlog.Infrastructure.FileSystem.UnitTests still returned TasksRepositoryRef, so the project did not compile. ReadmeTests failed because the project table had no row for Backlog.Infrastructure.Sessions, its unit tests, or Backlog.Infrastructure.BlobStorage.UnitTests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed desktop Inbox download recorded its reason on the row but logged nothing, so it never reached the Aspire structured logs or Application Insights. InboxAttachmentDownloads now writes one Warning per failure with the attachment id, the item id and the reason (the exception attached when there was one, never the file's name or bytes), through the logger of the handler that asked: ReceiveCaptureCommandHandler for the intake, RetryAttachmentCommandHandler for Retry. Both take it as an optional parameter, like their attachment ports. InboxAttachmentSyncSource stays silent: its failure is the reason logged here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both conflicts were main fixing the same two breaks this branch had mended: took main's README Sessions row and its Result<TasksRepositoryRef> double. Also adds the sourceInboxIds parameter to PaneInitialLoadTests.HeldTaskItems.ImportPlanAsync: #799 added the double while the batch route added the parameter to ITaskItems, so main's Backlog.Desktop.UI.UnitTests does not compile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 30, 2026
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.
Summary
When a desktop Inbox attachment download fails, the reason shows on the item's row but nothing was logged, so the failure never reached the Aspire structured logs or Application Insights. This logs each failure once, at Warning, with the attachment id, the item id and the reason — never the file's name or bytes. Follow-up listed in #698.
Changes
InboxAttachmentDownloads.Fail— the one place every failure path ends — writesCould not download attachment {AttachmentId} of inbox item {ItemId}: {Reason}via[LoggerMessage], with the exception attached when the failure was a throw. The class stays static;DownloadAsyncnow takes the caller'sILogger.ReceiveCaptureCommandHandler(intake) andRetryAttachmentCommandHandler(Retry) take an optionalILogger<T>(falling back toNullLogger), matching how their attachment ports are already optional — no host or test composition had to change.Backlog.Modules.InboxreferencesMicrosoft.Extensions.Logging.Abstractions, asBacklog.Modules.Syncalready does.InboxAttachmentSyncSourcedeliberately stays silent: its failure is the reason logged here, so logging there too would log each failure twice.AttachmentIntakeTests(fields are exactly AttachmentId/ItemId/Reason, the exception is carried, a replayed page does not log again, a failed Retry logs, a success logs nothing), with aRecordingLogger<T>double.Breaks on
main. This branch first mended two (staleIRepositoryDirectory.Registerdoubles after #793; missing README project rows).mainhas since fixed both itself, and the merge takesmain's side, so neither remains in the diff. The merge commit does fix a third:PaneInitialLoadTests.HeldTaskItemslacked thesourceInboxIdsparameter the batch route added toITaskItems.ImportPlanAsync(#799 and the batch route crossed), soBacklog.Desktop.UI.UnitTestsdid not compile onmain.Testing
dotnet build Backlog.sln: 0 errors.dotnet test Backlog.sln: 9912/9912; after mergingmain, 9950 passed and 1 skipped.ConferenceDayTests: 1/1 pass; no download warnings on the happy path.desktop-web-harnessstructured logs fromReceiveCaptureCommandHandler, withAttachmentId,ItemId(matching the row) andReason; the file name appears nowhere in the logs.RetryAttachmentCommandHandler.syncitself logs nothing when a blob read times out (traces only).Related
Refs #698 (listed this as a follow-up). Backlog plan item
e245049f-2270-4e9e-b788-f44f12ce5043(+mobile-inbox-slice-follow-up). The Capture attachments requirement in.devbook/domain/inbox/requirements.mdgets its logging clause through the devbook flow as a follow-up.Checklist
mainfixes are isolated in their own commit)🤖 Generated with Claude Code