Skip to content

fix: member attributes should have non empty values and a filled default#3449

Merged
themarolt merged 28 commits intomainfrom
member-attribute-fix-CM-705
Mar 24, 2026
Merged

fix: member attributes should have non empty values and a filled default#3449
themarolt merged 28 commits intomainfrom
member-attribute-fix-CM-705

Conversation

@themarolt
Copy link
Copy Markdown
Contributor

@themarolt themarolt commented Oct 4, 2025

Changes proposed ✍️

What

copilot:summary

copilot:poem

Why

How

copilot:walkthrough

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screenshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

Note

Medium Risk
Introduces a new batch script that updates persisted member attributes in-place and changes default-value derivation/deletion logic, so mistakes could affect many member records. Type/signature tweaks are low risk but could surface runtime issues if any call sites weren’t updated consistently.

Overview
Fixes how member attribute default values are derived by only considering non-empty platform-specific values and by preserving existing non-empty default values instead of deleting the attribute when no platform source exists.

Adds a fix-member-attributes worker script to backfill members whose attribute objects have empty default values despite having non-empty platform values; it batches through affected members, recomputes defaults via MemberAttributeService, and preserves manually-changed attributes based on manuallyChangedFields before writing updates.

Cleans up member creation/update call paths to use PlatformType consistently (incl. MemberAttributeService.validateAttributes parameter order and ActivityService member creation metadata typing).

Written by Cursor Bugbot for commit 8775bd9. This will update automatically on new commits. Configure here.

@themarolt themarolt requested a review from skwowet October 4, 2025 17:22
skwowet
skwowet previously approved these changes Oct 8, 2025
@joanagmaia
Copy link
Copy Markdown
Contributor

Hey @themarolt @skwowet. Shouldn't this be merged? If it was done 3 months ago, maybe the work has already been overridden? Or is this not needed anymore?

@skwowet
Copy link
Copy Markdown
Collaborator

skwowet commented Jan 14, 2026

@joanagmaia this should be merged, if I’m not mistaken.

I think it came from one of the support tickets (trying to remember which one..)

@joanagmaia
Copy link
Copy Markdown
Contributor

@themarolt pinging once again on this one, should this be merged or closed?

@themarolt
Copy link
Copy Markdown
Contributor Author

@themarolt pinging once again on this one, should this be merged or closed?

Oh damn - I totally forgot about this one - let me merge main and check if this is still relevant.

Copilot AI review requested due to automatic review settings March 23, 2026 20:46
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

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 aims to ensure member attribute “default” values are derived from a non-empty platform value (based on platform priority), and adjusts the data sink worker to pass PlatformType through the member/attribute validation pipeline. It also adds a one-off script to backfill/fix existing members with missing attribute defaults.

Changes:

  • Update shared setAttributesDefaultValues logic to ignore empty/blank platform values when choosing the default.
  • Reorder/propagate PlatformType through MemberAttributeService.validateAttributes and MemberService create/update flows.
  • Add a fix-member-attributes.ts script to patch existing DB records with empty default attribute values.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
services/libs/common/src/member.ts Filters attribute platforms to non-empty values before selecting the default.
services/apps/data_sink_worker/src/service/memberAttribute.service.ts Reorders validateAttributes params to accept platform first.
services/apps/data_sink_worker/src/service/member.service.ts Changes create/update signatures and call sites to use PlatformType (instead of source: string).
services/apps/data_sink_worker/src/service/activity.service.ts Updates member creation call to satisfy new PlatformType signature (currently via cast).
services/apps/data_sink_worker/src/bin/fix-member-attributes.ts New batch script to find and fix members with empty attribute defaults.

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

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

…utes

Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
@themarolt themarolt force-pushed the member-attribute-fix-CM-705 branch from c65b63c to b444f81 Compare March 23, 2026 21:13
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

Signed-off-by: Uroš Marolt <uros@marolt.me>
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

Signed-off-by: Uroš Marolt <uros@marolt.me>
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Signed-off-by: Uroš Marolt <uros@marolt.me>
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@themarolt themarolt merged commit 2352f05 into main Mar 24, 2026
14 checks passed
@themarolt themarolt deleted the member-attribute-fix-CM-705 branch March 24, 2026 15:37
skwowet pushed a commit that referenced this pull request Mar 25, 2026
…ult (#3449)

Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
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.

4 participants