Repository navigation
Исправить удаление выполненных позиций списка покупок - #857
Open
dankarization wants to merge 6 commits into
Open
dankarization wants to merge 6 commits into
dankarization wants to merge 6 commits into
Conversation
Chunk completed removals before sending and stop when the same delete leaves the list unchanged, so a "not found" reply cannot loop. Keep HA completed flags for items Alice did not actually remove.
Start below the observed 4-5 item failure, and if Alice rejects a chunk without changing the list, try a smaller chunk instead of ending the sync. A single rejected item is skipped so the rest can still be removed.
Owner
|
Идея понятна, но такой нейрослоп я точно не прийму. |
Author
|
Займусь очисткой. |
Abort on unreadable or incomplete list snapshots instead of reusing stale indexes. Fall back only after a confirmed refusal and a fresh unchanged list; report partial removals while preserving completed flags. Remove the successful-iteration cap and unrelated selector and ID changes. Replace standalone module stubs with scoped pytest regressions.
Exercise the status-only SUCCESS response observed on the live local protocol. It must abort both sync paths without stale-index deletes or saving an unreadable list.
Station sendText now acknowledges without vinsResponse, so the local card path cannot see Alice's list. Notes RPC is a different empty store. Reuse the existing cookie session to ask the assistant for the numbered text, keep Glagol for add/delete, and still abort if that text is missing.
Glagol indexes follow the speaker. A cloud/assistant snapshot can be a different order or account, so using it to build "Удали N" can remove an active item. Abort again when the station returns no card, and cover the reordered-list case. Leave any new transport out of this PR.
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.
Проблема
Синхронизация списка покупок (
media_content_type=shopping_list,media_content_id=update) отправляет Алисе одну команду «Удали» сразу с несколькими индексами. Сейчас это до 5 индексов за раз.Если отметить выполненными больше 4–5 позиций и запустить обновление, колонка отвечает «не найдено» и ничего не удаляет. Список после повторного опроса не меняется, цикл снова видит те же индексы и отправляет ту же команду. Повтор не заканчивается.
Пачка из 5 индексов не удаляет ничего, потому что Алиса отклоняет такое удаление и отвечает «не найдено». Следующий запрос списка возвращает те же позиции, условие цикла остаётся истинным, и та же команда уходит снова.
Ранее это обсуждалось в #405.
Что изменено
updateрежет удаление до отправки, а не после ошибки. Первая команда содержит не больше 3 индексов: это ниже наблюдённого сбоя на пачке больше 4–5.needs_actionк удалению не выбираются.Как проверено
tests/test_shopping_sync.py: 13 ok.shopping_list/update).