bf7dca0a09
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 11s
CI / ui (pull_request) Has been skipped
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m6s
Two owner-reported defects from a live contour game. A. Frequency: the robot's proactive nudge fired hourly for 12h+ (a 12h idle threshold then the 1h cooldown, uncapped). Replaced with a lengthening, randomized schedule (proactiveNudgeGap): the first nudge ~60-90 min into the human's turn, each later gap growing toward 1-6h (uniform sample in [60min, ceil], ceil ramping 90min->6h over 12h of idle, measured from the previous nudge), so a long wait gets a handful of increasingly-spaced reminders instead of a stream. B. Language: out-of-app push routed by the recipient's GLOBAL service_language (last-login-wins), so after re-logging via the RU bot an English game's nudges came from the RU bot. Now a game push (your_turn, game_over, nudge, match_found) carries the game's own language (engine.Variant.Language) on push.Event, and the gateway routes by it (falling back to service_language for non-game pushes). The New-Game variant-gating guarantees the game's bot is one the player has started, so delivery is never blocked. Tests: proactiveNudgeGap unit + retimed TestRobotProactiveNudge; TestVariantLanguage; emit your_turn/game_over language; TestNudgeRoutedByGameLanguage integration. Docs: ARCHITECTURE (§7 nudge, §10/§13 routing), FUNCTIONAL (+ _ru), PLAN tracker.
42 lines
1.8 KiB
Protocol Buffer
42 lines
1.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
// Package scrabble.push.v1 is the backend -> gateway live-event control channel.
|
|
// The gateway opens Subscribe once at startup and keeps the stream open; the
|
|
// backend pushes one Event per notification intent. The payload is an opaque
|
|
// FlatBuffers message (the scrabblefb.* tables) that the gateway forwards to the
|
|
// client without re-interpreting it. The transport is plain gRPC server-stream
|
|
// (ARCHITECTURE.md §2); the client edge is Connect-RPC (gateway/proto/edge).
|
|
package scrabble.push.v1;
|
|
|
|
option go_package = "scrabble/pkg/proto/push/v1;pushv1";
|
|
|
|
// Push is the unidirectional live-event channel from backend to gateway.
|
|
service Push {
|
|
// Subscribe opens the single backend -> gateway event stream. The backend
|
|
// sends every event for every user; the gateway fans them out to the active
|
|
// client subscriptions by user_id.
|
|
rpc Subscribe(SubscribeRequest) returns (stream Event);
|
|
}
|
|
|
|
// SubscribeRequest opens a push subscription. gateway_id identifies the gateway
|
|
// instance for logging; the MVP backend keeps no per-gateway state.
|
|
message SubscribeRequest {
|
|
string gateway_id = 1;
|
|
}
|
|
|
|
// Event is one live-event frame. kind is the notification catalog kind
|
|
// (your_turn, opponent_moved, chat_message, nudge, match_found). payload is the
|
|
// FlatBuffers-encoded body for that kind. event_id is a correlation id the
|
|
// gateway carries through to the client envelope.
|
|
message Event {
|
|
string user_id = 1;
|
|
string kind = 2;
|
|
bytes payload = 3;
|
|
string event_id = 4;
|
|
// language routes an out-of-app push to a specific per-language bot (Stage 17): for a game
|
|
// event it carries the game's language ("en"/"ru") so the notification comes from the game's
|
|
// bot rather than the recipient's last-login bot. Empty falls back to the recipient's service
|
|
// language at the gateway.
|
|
string language = 5;
|
|
}
|