Skip to content

fix: issue while merging member organizations (CM-1109)#4081

Merged
themarolt merged 1 commit intomainfrom
fix/member-org-role-date-iso-CM-1109
May 6, 2026
Merged

fix: issue while merging member organizations (CM-1109)#4081
themarolt merged 1 commit intomainfrom
fix/member-org-role-date-iso-CM-1109

Conversation

@themarolt
Copy link
Copy Markdown
Contributor

@themarolt themarolt commented May 6, 2026

Note

Medium Risk
Touches member-organization merge/delete logic used to reconcile work experiences; incorrect date normalization could change which rows are matched for removal or merging.

Overview
Fixes member-organization merging/removal when dateStart/dateEnd values are sometimes strings instead of Date objects.

Adds a small toIsoString helper and uses it when building SQL predicates and merged role payloads, avoiding invalid casts/toISOString() calls during merge operations.

Reviewed by Cursor Bugbot for commit 68e1000. Bugbot is set up for automated code reviews on this repo. Configure here.

Signed-off-by: Uroš Marolt <uros@marolt.me>
Copilot AI review requested due to automatic review settings May 6, 2026 18:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a runtime issue during member-organization merge flows by normalizing dateStart/dateEnd values to ISO strings regardless of whether they come through as Date objects or strings, aligning with IMemberOrganization’s Date | string | null typing.

Changes:

  • Added a local toIsoString(Date | string) helper to consistently convert date values to ISO strings.
  • Updated removeMemberRole() to use toIsoString() for dateStart/dateEnd SQL replacements (avoids calling .toISOString() on string values).
  • Updated mergeRoles() to use toIsoString() when constructing an updated “current role” payload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@themarolt themarolt merged commit 5ad2fd2 into main May 6, 2026
22 checks passed
@themarolt themarolt deleted the fix/member-org-role-date-iso-CM-1109 branch May 6, 2026 19:11
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.

2 participants