Skip to content

Документ, файл которого не прочитался, снова не считается прочитанным (правка #4625 потерялась при мерже #4606) - #4633

Merged
nixel2007 merged 1 commit into
developfrom
fix/context-failed-file-read-restore
Oct 12, 2026
Merged

nixel2007 merged 1 commit into
developfrom
fix/context-failed-file-read-restore

Conversation

@sfaqer

@sfaqer sfaqer commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Что случилось

#4625 влит (a97b717), но в develop его правки больше нет: в DocumentContext.rebuildFromFileSystem снова void, ServerContext.rebuildDocument безусловно ставит WITH_CONTENT, а теста rebuildDocumentFromUnreadableFileLeavesDocumentWithoutContent нет.

Правку снял мерж #4606 (a06f783). Ветку #4606 перед вливанием перебазировали поверх develop, уже содержавшего #4625: слияние-база мержа — сам a97b717. В истории #4606 были два моих коммита: сначала та же правка, что в #4625, затем её откат, когда я убирал её из #4606, чтобы вынести отдельным PR. При перебазировании первый коммит вышел пустым, а откат (87ea6f3) лёг поверх #4625 и убрал из develop и код, и тест. Поэтому CI остался зелёным.

Что сделано

Коммит #4625 повторно, без изменений, поверх текущего develop: rebuildDocument помечает документ прочитанным только после успешного чтения, после сорвавшегося документ остаётся WITHOUT_CONTENT, и следующий вызов читает файл снова.

Проверка

ServerContextTest.rebuildDocumentFromUnreadableFileLeavesDocumentWithoutContent вернулся. ./gradlew cleanTest check: 4526 тестов, 0 падений.

@nixel2007 на будущее: перебазировать ветку, в истории которой есть «сделал — откатил», поверх develop с той же правкой — значит снять правку. Мерж develop в ветку или squash такого не дают.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Documents are marked as containing content only after their files are read successfully. If a read fails, the document remains eligible for a later retry.

…очитанным

rebuildDocument ставил WITH_CONTENT и после сорвавшегося чтения: документ числился
с текстом, которого нет, и следующие вызовы файл уже не перечитывали.

Повторно: эта правка (#4625) потерялась при перебазировании #4606 — в его истории
был коммит, откатывающий такую же правку, и он лёг поверх #4625.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: 1c-syntax/bsl-language-server/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 99af30d8-b476-485b-a2df-d630003c00a1

📥 Commits

Reviewing files that changed from the base of the PR and between 8042981 and b72abcc.


📒 Files selected for processing (3)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/DocumentContext.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/context/ServerContext.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/context/ServerContextTest.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.



📝 Walkthrough

Walkthrough

File rebuilds now return a success result. rebuildDocument sets the document state to WITH_CONTENT only after a successful rebuild. A test verifies that a failed read leaves the document retryable.

Changes

Document rebuild state handling

Layer / File(s) Summary
Report rebuild success
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/DocumentContext.java
rebuildFromFileSystem() returns true after rebuilding and false when file reading or URI-path handling fails.
Update document state after success
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/ServerContext.java, src/test/java/com/github/_1c_syntax/bsl/languageserver/context/ServerContextTest.java
rebuildDocument sets the state to WITH_CONTENT only after a successful rebuild. The test checks that a failed read leaves the document in WITHOUT_CONTENT, and that a later successful read loads the content.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: nixel2007


Merge Risk: ⚪ Minimal · up to b72ab

The change preserves retry after an initial file-read failure, and no actionable merge risk remains in the reviewed changes.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: a document remains unread when its file cannot be read. It also gives relevant context about the restored fix.
Docstring Coverage Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

 4 338 files  ±0   4 338 suites  ±0   1h 4m 33s ⏱️ - 5m 31s
 4 526 tests +1   4 436 ✅ +1   90 💤 ±0  0 ❌ ±0 
27 156 runs  +6  26 604 ✅ +6  552 💤 ±0  0 ❌ ±0 

Results for commit b72abcc. ± Comparison against base commit 8042981.

@nixel2007

Copy link
Copy Markdown
Member

@nixel2007 на будущее: перебазировать ветку, в истории которой есть «сделал — откатил», поверх develop с той же правкой — значит снять правку

@sfaqer пушить в ветку на ревью правку и её откат - значит не уважать ревьювера. Ты способен презентовать чистую линейную историю без вот этой вот херни.

@nixel2007
nixel2007 merged commit bee2f9a into develop Oct 12, 2026
37 checks passed
@nixel2007
nixel2007 deleted the fix/context-failed-file-read-restore branch October 12, 2026 18:14
@sentry

sentry Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Issues attributed to commits in this pull request

This pull request was merged and Sentry observed the following issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants