Skip to content

Fix retry_statuses dropped because list.append() returns None#93

Open
mark124 wants to merge 1 commit into
edanalytics:mainfrom
mark124:patch-1
Open

Fix retry_statuses dropped because list.append() returns None#93
mark124 wants to merge 1 commit into
edanalytics:mainfrom
mark124:patch-1

Conversation

@mark124

@mark124 mark124 commented Jul 14, 2026

Copy link
Copy Markdown

What

EdFiAPI.get_retry_client() builds its retry-status set as:

statuses=self.lightbeam.config['connection']["retry_statuses"].append(401)

list.append() returns None, so statuses=None reaches ExponentialRetry and the configured retry_statuses (429/500/501/503/504) are dropped - a 429 rate-limit is never retried. It also mutates config['connection']['retry_statuses'] in place, appending another 401 on every call.

Fix

Build a fresh list - a copy of the configured statuses plus 401:

statuses=[*self.lightbeam.config['connection']["retry_statuses"], 401]

One line; fixes both the dropped statuses and the in-place mutation. (The edit also adds a trailing newline at end of file - the second line in the diff.)

Verified

get_retry_client() now retries {429, 500, 501, 503, 504, 401}, and the config list is unchanged across repeated calls.

Addresses the retry-client bug noted in the "Related bug (compounding)" section of #92.

@snyk-io-us

snyk-io-us Bot commented Jul 14, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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