Skip to content

ref(chat): Persist location configuration in SQL - #1357

Merged
dcramer merged 10 commits into
mainfrom
ref/channel-configuration-sql
Aug 9, 2026
Merged

ref(chat): Persist location configuration in SQL#1357
dcramer merged 10 commits into
mainfrom
ref/channel-configuration-sql

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Move user-authored configuration off expiring Redis scratch into durable SQL, scoped to a provider Location.

Ownership

  • junior_location_configurations.location_id references the canonical Location row in junior_destinations
  • Each (location_id, key) has one row with a text value
  • Runtime routing supplies a Destination only to resolve the associated Location; Destination remains reply-delivery data
  • API and entry scope use Location / location

Cutover

  • Existing live Redis channel-state entries copy into Location configuration on the first Slack read
  • New writes go only to SQL
  • Concurrent SQL writes win over stale Redis entries
  • The Redis fallback has an explicit #1267 / v0.147.0 removal marker

Checks

  • Typecheck and lint pass
  • Focused tests: 16/16

This follows the Source / Location / Destination split in #1200 and does not overlap the reply-delivery changes in #1238.

Refs #1267

Co-Authored-By: David Cramer <david@sentry.io>
@vercel

vercel Bot commented Aug 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview Aug 9, 2026 10:25pm

Request Review

Store user configuration under destinationKey instead of bare channelId so
Slack and future providers share one durable identity. Keep a one-time Redis
channel-state cutover for live Slack records.

Co-Authored-By: David Cramer <david@sentry.io>
@sentry-junior sentry-junior Bot changed the title ref(chat): Persist channel configuration in SQL ref(chat): Persist destination configuration in SQL Aug 9, 2026
Key configuration by the canonical Location row instead of a serialized Destination. Resolve or create the provider Location before reading or writing configuration.

Co-Authored-By: David Cramer <david@sentry.io>
@sentry-junior sentry-junior Bot changed the title ref(chat): Persist destination configuration in SQL ref(chat): Persist location configuration in SQL Aug 9, 2026
…tion-sql

# Conflicts:
#	packages/junior/src/chat/runtime/turn-preparation.ts

Co-Authored-By: David Cramer <david@sentry.io>
@dcramer
dcramer marked this pull request as ready for review August 9, 2026 21:48
@github-actions github-actions Bot added the risk: high PR risk score: high label Aug 9, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ea5bdbd. Configure here.

Comment thread packages/junior/src/chat/configuration/sql.ts Outdated
Insert Redis cutover rows only when SQL is still empty, then re-read so a concurrent set wins.
Co-Authored-By: David Cramer <david@sentry.io>
Co-Authored-By: David Cramer <david@sentry.io>
Co-Authored-By: David Cramer <david@sentry.io>
Co-Authored-By: David Cramer <david@sentry.io>
@dcramer
dcramer merged commit 274db8c into main Aug 9, 2026
37 checks passed
@dcramer
dcramer deleted the ref/channel-configuration-sql branch August 9, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant