Repository navigation
fix: apply header rules in order and open settings on the options page - #157
Merged
Merged
Conversation
Kirrrusha
force-pushed
the
fix/update-request-with-tab-windows
branch
from
August 5, 2026 13:26
9882193 to
8751d6c
Compare
|
PR tester build for Artifact folder: https://github.com/cloud-ru-tech/cloudhood/tree/artifacts/pull-requests/157 Commit: |
raidenmiro
reviewed
Aug 5, 2026
cursor
Bot
force-pushed
the
fix/update-request-with-tab-windows
branch
from
September 9, 2026 06:52
a208d36 to
4560a49
Compare
Store a monotonic headers config meta and run background applies through a single-flight queue so an older storage snapshot cannot overwrite a newer one. Retry transient declarativeNetRequest failures and fall back to session rules when dynamic updates fail. Co-authored-by: Kirill Lebedenko <kirilllebedenko@gmail.com>
Apply stored headers on service worker startup so disabled headers are not left active after Chrome kills the worker. Restart tests drive the same apply path through a storage fingerprint change. Co-authored-by: Kirill Lebedenko <kirilllebedenko@gmail.com>
Clear stale dynamic rules as soon as the worker boots, give counteracting session rules priority over stuck dynamic rules, and serialize rule updates. Show a warning in the popup when Chrome reports that a header was not applied. Co-authored-by: Kirill Lebedenko <kirilllebedenko@gmail.com>
cursor
Bot
force-pushed
the
fix/update-request-with-tab-windows
branch
from
November 2, 2026 18:15
eaa0432 to
e44707e
Compare
cursor
Bot
force-pushed
the
fix/update-request-with-tab-windows
branch
from
November 2, 2026 18:28
a7abb5b to
6340cf5
Compare
cursor
Bot
force-pushed
the
fix/update-request-with-tab-windows
branch
from
November 2, 2026 18:47
ba489da to
8f0fe32
Compare
cursor
Bot
force-pushed
the
fix/update-request-with-tab-windows
branch
from
November 2, 2026 19:17
8f0fe32 to
5f71a53
Compare
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
Исправляет Windows-специфичную гонку, когда при переключении вкладок и редактировании заголовков могли применяться устаревшие значения (старый снапшот из storage), перезаписывая актуальную конфигурацию.
Changes
declarativeNetRequest.updateDynamicRules({ removeRuleIds, addRules })одним вызовом, чтобы избежать гонки remove→add.headersConfigMetaV1(seq, монотонныйupdatedAt) и в background пропускаем устаревшие снапшоты, даже если события приходят не по порядку.tabs.onActivatedтолько увеличивала вероятность гонок.updateOverrideHeaders/runtime reload message; обновления теперь идут черезstorage.onChanged.Why this works
На Windows из-за другой латентности и планирования событий чаще происходили перекрывающиеся триггеры применения правил. Версионирование + очередь не позволяют применить старую конфигурацию "после" новой.
Test plan
pnpm test:unitApply skipped (stale meta)), а применения идут последовательно.Notes
seq— best-effort при конкурентных записях;updatedAtпринудительно монотонный и используется как tie-breaker.Summary
Ветка пересобрана поверх актуального
main. Конфликты со скриншотами и UI после миграции на@cloud-ru/dsразрешены, история схлопнута в четыре коммита. Временное отключение e2e в workflow не перенесено.Исправляет гонку, когда при переключении вкладок и редактировании заголовков применялся устаревший снапшот из storage и перезаписывал актуальную конфигурацию.
Последний коммит — страница настроек из
cursor/settings-log-download-a9c1, вместе с эталонами скриншотов из CI. Chrome и Firefox регистрируютoptions_uiсoptions.htmlиopen_in_tab. Шестерёнка рядом с иконкой GitHub вызываетbrowser.runtime.openOptionsPage(). В настройках: тема, скачивание логов расширения и профиля, версия Cloudhood.Commits
fix: version header config and apply DNR rules in order— монотоннаяheadersConfigMetaV1, очередь в background, повтор временных ошибок DNR и запасной путь через session rules.fix: reconcile DNR rules when the service worker restarts— применение правил на старте worker, чтобы выключенные заголовки не оставались активными после его перезапуска.fix: keep disabled headers off when dynamic rules stick— ранняя очистка stale dynamic rules, counteracting session rules с priority 2, сериализация обновлений и предупреждение в popup, если Chrome не применил правило.feat: open extension settings on the browser options page— настройки и скачивание логов изcursor/settings-log-download-a9c1, плюс эталоны скриншотов страницы настроек из CI. Для скриншота с несколькими URL-фильтрами допуск 400 пикселей. Сброс курсора применения, если meta удалили из storage. Зависший вызов badge API в Firefox больше не блокирует следующие обновления заголовков.Test plan
pnpm test:unit— 132 теста