Skip to content

Conversation

@ziaddevv
Copy link
Contributor

@ziaddevv ziaddevv commented Dec 24, 2025

The bug had some minor issues :

Schedule existence check was using the wrong ID (s_id instead of builder_id) causing the code to think schedules didn't exist when they actually did , This led to 409 Conflict errors when trying to create "new" schedules

after fixing the ID issue , I hit a 405 Method Not Allowed error because the PATCH request was going to /v2/schedules instead of /v2/schedules/{schedule_name} . I have investigated The Zimfarm API requires the schedule name in the URL path

after fixing both API issues the request was made and the ZIM was created but download URLs were still broken because the task_id wasn't being updated properly when selection versions changed, and the version pointer (b_selection_zim_version) still pointed to the old selection

Changes made:

zimfarm.py : Use builder_id instead of s_id for schedule checks, and fix PATCH URL to include schedule name in the path
builder.py: Add three layer update logic (try current selection - - > try by schedule_id --> insert new) and update b_selection_zim_version to point to current selection when requesting ZIMs

I have tested this locally , by reproducing the same issue , it worked fine , i have successfully regenerated the failed ZIMs and verified the download links works fine

I tried to explain the issue well , please review it , maybe I found the causes of the issue , but actually I'm not sure if this is the correct way to solve it
fixes #1036

@audiodude
Copy link
Member

I don't have time to review the code right now, I only read the description. But I wanted to leave immediate feedback to tell you that, based on your description, I really appreciate the problem solving and effort that went into this PR. And I apologize for the state of the code that caused this bug.

I am interested in how the tests passed for this deficient code, but I expect that they were also deficient in the sense that they were testing the incorrect behavior instead of the behavior we actually desired. Please make sure to run and update tests as necessary.

Again, thank you so much! I will review this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants