refactor(streaming): イベント envelope に specta を付与し state を enum 化 - #37
Merged
Conversation
notedeck#781 Phase 2。全ストリーミングイベント envelope struct に Deserialize + specta::Type (cfg_attr) を付与し、tauri-specta の collect_events! に載せられるようにする。StreamStatusEvent.state は 自由文字列から StreamConnectionState enum (connected / reconnecting / disconnected、serde lowercase でワイヤ不変) に変更。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
なぜ
notedeck-dev/notedeck#781 Phase 2。
stream-status/stream-chat-message-reacted/-unreactedを tauri-specta の型契約に載せるため、envelope struct を specta 対応させる。notedeck 側では現在 chat reaction の直接イベントに emit 元がなく(stream-event 統合時に失われた)、リスナーが発火しないバグがあり、この型付き化が修正を兼ねる。変更内容
Deserialize+cfg_attr(feature = "specta", derive(specta::Type))を付与(models.rs の既存パターン踏襲、Phase 3 の StreamEvent enum 化の下準備も兼ねる)StreamStatusEvent.state: String→StreamConnectionStateenum(connected / reconnecting / disconnected)。serde lowercase でワイヤ形は不変payload["state"] == "reconnecting"の契約テスト含む)🤖 Generated with Claude Code