mirror of
https://github.com/stablyai/orca.git
synced 2026-10-27 08:02:51 +00:00
Fix Jira credentials clearing on forbidden task reads (#5757)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -390,4 +390,16 @@ describe('createJiraSlice credential errors', () => {
|
||||
expect(store.getState().jiraStatus.credentialError).toBeUndefined()
|
||||
})
|
||||
})
|
||||
|
||||
it('keeps Jira connected when an issue read hits endpoint-level forbidden access', async () => {
|
||||
const store = createTestStore()
|
||||
store.setState({
|
||||
jiraStatus: { connected: true, viewer: null, selectedSiteId: 'site-1' }
|
||||
})
|
||||
jiraListIssues.mockRejectedValueOnce(new Error('Forbidden'))
|
||||
|
||||
await expect(store.getState().listJiraIssues('assigned', 30)).resolves.toEqual([])
|
||||
|
||||
expect(store.getState().jiraStatus.connected).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -55,7 +55,9 @@ function evictStaleEntries<T>(
|
||||
|
||||
function looksLikeAuthError(error: unknown): boolean {
|
||||
const msg = error instanceof Error ? error.message : String(error)
|
||||
return /authenticat|unauthorized|forbidden|401|403/i.test(msg)
|
||||
// Why: Jira 403 commonly means endpoint/project access is denied while the
|
||||
// saved token is still valid; do not flip Settings back to disconnected.
|
||||
return /authenticat|unauthorized|401/i.test(msg)
|
||||
}
|
||||
|
||||
type InflightJiraReadRequest<T> = {
|
||||
|
||||
Reference in New Issue
Block a user