Skip to content

Incorrect due dates on Canvas assignments#337

Open
noahnizamian wants to merge 1 commit intomainfrom
canvas_due_date_patch
Open

Incorrect due dates on Canvas assignments#337
noahnizamian wants to merge 1 commit intomainfrom
canvas_due_date_patch

Conversation

@noahnizamian
Copy link
Copy Markdown

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

@noahnizamian noahnizamian self-assigned this Mar 29, 2026
@noahnizamian noahnizamian added bug Something isn't working points: 3 labels Mar 29, 2026
@noahnizamian noahnizamian changed the title patch + rspec tests Incorrect due dates on Canvas assignments Mar 29, 2026
alxstx pushed a commit that referenced this pull request Mar 31, 2026
…m_and_yarn-826852524d

Bump undici from 6.22.0 to 6.24.0 in the npm_and_yarn group across 1 directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working points: 3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant