Fix TC message log write failure preventing collection from opening (BL-16772) - #8255
Conversation
|
| Filename | Overview |
|---|---|
| src/BloomExe/TeamCollection/TeamCollectionMessageLog.cs | Handles message-log persistence failures without disrupting Team Collection initialization. |
| src/BloomTests/TeamCollection/TeamCollectionMessageLogTests.cs | Adds regression coverage confirming an unwritable log does not discard the in-memory message or throw. |
Reviews (2): Last reviewed commit: "Fix BL-16772 TC message log write failur..." | Re-trigger Greptile
|
[Claude Fable 5] Consulted Devin on 2026-08-28 ~19:25 UTC up to commit 1798dbf. Result: no bugs, no Investigate flags; 1 informational note (confirming the message survives in memory/Logger when the file write fails). Nothing to mirror. |
…pening https://issues.bloomlibrary.org/youtrack/issue/BL-16772 When the local collection folder is not writable (e.g. read-only files), TeamCollectionMessageLog.WriteMessage threw while the TeamCollectionManager constructor was reporting a TC initialization failure. The exception escaped the constructor and the collection failed to open entirely, instead of opening with the Team Collection in disconnected mode (the BL-16227 fallback). Now a failure to persist a message is logged and swallowed; the message is still shown in the current session. Tests: added WriteMessage_LogFileNotWritable_DoesNotThrowAndKeepsMessageInMemory; all 203 BloomTests.TeamCollection tests pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1798dbf to
da662d8
Compare
|
[Claude Fable 5] Consulted Devin on 2026-08-28 ~20:20 UTC up to commit da662d8 (branch rebuilt on Version6.4). Result: no bugs, no Investigate flags; the same single informational note as before. Nothing to mirror. |
StephenMcConnel
left a comment
There was a problem hiding this comment.
@StephenMcConnel reviewed 2 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on andrew-polk).
Problem: A user whose Team Collection's local folder contains read-only files could not open their collection at all. Bloom reported a raw
UnauthorizedAccessException("Access to the path ...log.txt is denied") and gave up, even though the TC code has a disconnected-mode fallback (added for BL-16227) designed to let the collection open with Team Collection features degraded.Cause: When TC initialization failed (a sync write to the unwritable folder threw), the recovery path in the
TeamCollectionManagerconstructor built aDisconnectedTeamCollectionand then wrote an error message viaTeamCollectionMessageLog.WriteMessage— which appends tolog.txtin the same unwritable folder. That second exception escaped the constructor uncaught, killed the Autofac resolve, and prevented the wholeProjectContextfrom being created.Fix:
TeamCollectionMessageLog.WriteMessagenow catches a failure to persist a message tolog.txt, logs it via the SIL Logger, and continues. The message is already in the in-memory list and the Logger before the file write, so the current session still shows it; it just won't survive a restart. A regression test makes the log file read-only and verifiesWriteMessagedoesn't throw and keeps the message in memory. The PR targets Version6.4 directly (the affected user is on 6.4 Beta); the change is deliberately minimal. Version6.4 merges forward to 6.5/master per the usual flow.Ref: https://issues.bloomlibrary.org/youtrack/issue/BL-16772
Devin review
This change is
Devin review