A report's push: its words are in the payload's notification
CI / check (push) Canceled after 0s

The payload's top says only the app's name and "New report"; the title,
the summary and the importance are read from its notification, and from
the top only where there is none.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Fable 5.2 committed 2026-11-13 09:56:15 +00:00
1 parent adc1c4fe3e
commit dcd5adf491
3 files changed
+26 -1

No files matched your search

@@ -118,6 +118,20 @@ class ReportsTest {
assertNull(ScheduledNotice.from(payload))
}
@Test
fun theReportsWordsComeFromThePayloadsNotification() {
// The payload's top is for a client that knows nothing of reports; the words are inside.
val payload = LembasJson.decodeFromString(
PushPayload.serializer(),
"""{"kind":"report","report_id":"rep1","title":"LLeMbas","body":"New report","url":"/reports/rep1",
"notification":{"title":"Two tenders opened","body":"Storage bids are due in May.","public":{"title":"New report","body":""},"importance":"high"}}""",
)
val notice = ReportNotice.from(payload)!!
assertEquals("Two tenders opened", notice.title)
assertEquals("Storage bids are due in May.", notice.summary)
assertTrue(notice.high)
}
@Test
fun anOlderServersScheduledPushStillWorks() {
// 2.0.0-beta.11 and before: a run's result is its own push, which opens the run.