Skip to content

Fix incorrect due dates on canvas#395

Open
noahnizamian wants to merge 1 commit intoberkeley-cdss:mainfrom
cs169:canvas_due_date_patch
Open

Fix incorrect due dates on canvas#395
noahnizamian wants to merge 1 commit intoberkeley-cdss:mainfrom
cs169:canvas_due_date_patch

Conversation

@noahnizamian
Copy link
Copy Markdown
Contributor

General Info

original issue:

Changes

Canvas API's due_at field can return incorrect values for teacher accounts when assignment overrides exist, so for a workaround we now fetch all_dates array and extract base date entry.
canvas for some reason imposes a limit of 25 on the number of dates returned by all_dates, and then returns an empty array.
so, this PR adds a fallback so that when base_date cant be extracted, the existing local due dates are preserved for already synced assignments instead of being overwritten with potentially incorrect top level due_at. New assignments still pick up the due dates from the API since theres no existing dates to preserve.

Testing

Added unit tests covering:

  • base_date extraction from all_dates when present (uses correct base date)
  • Empty all_dates array (>25 overrides): existing assignment dates are preserved
  • Empty all_dates array for new assignments: dates are still set from the API
  • Facade correctly handles both populated and empty all_dates arrays

Documentation

none needed

Checklist

  • Name of branch corresponds to story

@superconductor-for-github
Copy link
Copy Markdown

superconductor-for-github Bot commented Apr 23, 2026

@noahnizamianSuperconductor finishedView implementation | App Preview


Standing by for instructions.

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