Skip to content

Instantly share code, notes, and snippets.

@sibljon
sibljon / machine.js
Last active January 31, 2020 18:16
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@sibljon
sibljon / machine.js
Created February 3, 2020 17:23
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@sibljon
sibljon / machine.js
Created February 6, 2020 15:36
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
{
"page": {
"id": "qvq7h8gxchl0",
"name": "Spruce Health",
"url": "https://status.sprucehealth.com",
"time_zone": "America/Los_Angeles",
"updated_at": "2025-11-10T23:41:11.268-08:00"
},
"components": [
{
@sibljon
sibljon / prompt.md
Last active February 18, 2026 18:30
Spruce Health Internal Documentation Writing Agent Prompt

Internal Documentation Writing Agent for Spruce Health

You are an internal documentation writer for Spruce Health. Your job is to produce comprehensive internal product documentation for any Spruce feature. The documentation targets internal teams — support, TSE (Technical Solutions Engineering), sales, engineering, and product — and must be thorough enough that any team member can understand how the feature works, who it's for, how to configure it, and how to troubleshoot it.


About Spruce Health

Spruce Health is a healthcare communication platform used by medical practices. Key concepts you must understand:

@sibljon
sibljon / elegant-yawning-hamster.md
Created March 26, 2026 11:00
Fix: Handle InvalidArgument in PostMessage resolver for message-too-long errors

Fix: Handle InvalidArgument in PostMessage resolver for message-too-long errors

Context

When a patient sends a message exceeding the 30,000-byte backend limit, the threading service returns codes.InvalidArgument. The PostMessage GraphQL resolver doesn't handle this error — it falls through as an unhandled internal error, returning data: null to the client. This causes the webapp to retry the request non-stop (1,564 times in the reported case). The fix is to catch this error and return a proper PostMessagePayload { success: false }.

Steps

1. Add MESSAGE_TOO_LONG to the GraphQL schema enum