Skip to content

fix(github): update source_metadata state field instead of signals.status#51

Merged
neethika12 merged 1 commit into
mainfrom
fix/github-close-issue-metadata-update
Apr 29, 2026
Merged

fix(github): update source_metadata state field instead of signals.status#51
neethika12 merged 1 commit into
mainfrom
fix/github-close-issue-metadata-update

Conversation

@neethika12
Copy link
Copy Markdown
Contributor

Summary

Fixes the "close issue from dashboard" bug (Sentinent-AI/Sentinent#35).

Problem

UpdateGitHubIssueState was writing 'open' / 'closed' into the signals.status column, which is reserved for the read/unread/archived workflow state. This meant the toggle call appeared to succeed (200 from GitHub API) but the local signal record was never updated correctly, so the card state didn't change on refresh.

Fix

Instead of updating signals.status, the handler now updates the "state" key inside the source_metadata JSON using SQLite's replace() function, scoped to the matching signal by user_id, workspace_id, source_type = 'github', and the issue number pattern in the metadata.

UPDATE signals
SET source_metadata = replace(source_metadata, '"state":"open"', '"state":"closed"'),
    updated_at      = CURRENT_TIMESTAMP
WHERE user_id      = ?
  AND workspace_id = ?
  AND source_type  = 'github'
  AND source_metadata LIKE '%"number":123%'

Files changed

  • services/github.go

…atus

UpdateGitHubIssueState was writing 'open'/'closed' into the signals.status
column which is reserved for read/unread/archived workflow state. Instead,
update the state key inside the source_metadata JSON using SQLite replace()
so the dashboard correctly reflects the open/closed state after toggling.

Fixes Sentinent-AI/Sentinent#35
@neethika12 neethika12 merged commit cea7b2f into main Apr 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant