tegon icon indicating copy to clipboard operation
tegon copied to clipboard

fix: dueDate and labelids issues

Open AggManik opened this issue 1 year ago • 2 comments

Errors:

  1. Type mismatch error:
  • The dueDate field in the Issue model was expecting a string or null, but it was receiving a Date object.
  1. MobX-State-Tree conversion error:
  • Even when passing an ISO string, MobX-State-Tree was unable to assign the value to the dueDate field.
  1. State tree conflict with labelIds:
  • When updating the issue, there was an attempt to add an object to the state tree that was already part of another state tree, specifically with the labelIds field.

Fixes:

  • Updated the Issue model definition to explicitly handle dueDate as a nullable string.
  • Modified the dueDateChange function to convert Date objects to ISO strings before updating the issue.
  • Updated the update function in update-issue.tsx to properly handle both dueDate and labelIds when preparing update data.
  • Adjusted the updateIssue action in the store to create a new labelIds array, preventing state tree conflicts.
  • Implemented additional error handling and logging throughout the update process for better debugging.
  • Ensured that null values for dueDate are properly handled when clearing the date.
  • Addressed potential issues with existing labelIds to prevent conflicts when updating an issue.
  • These changes collectively resolve type mismatches, state tree conflicts, and improve the overall robustness of the due date update functionality.

AggManik avatar Oct 11 '24 11:10 AggManik

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tegon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2024 11:18am

vercel[bot] avatar Oct 11 '24 11:10 vercel[bot]