fix: member attributes should have non empty values and a filled default#3449
fix: member attributes should have non empty values and a filled default#3449
Conversation
|
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? |
|
@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..) |
|
@themarolt pinging once again on this one, should this be merged or closed? |
Oh damn - I totally forgot about this one - let me merge |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
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
setAttributesDefaultValueslogic to ignore empty/blank platform values when choosing the default. - Reorder/propagate
PlatformTypethroughMemberAttributeService.validateAttributesandMemberServicecreate/update flows. - Add a
fix-member-attributes.tsscript to patch existing DB records with emptydefaultattribute 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.
services/apps/data_sink_worker/src/bin/fix-member-attributes.ts
Outdated
Show resolved
Hide resolved
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
1 similar comment
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
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>
c65b63c to
b444f81
Compare
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
Signed-off-by: Uroš Marolt <uros@marolt.me>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
services/apps/data_sink_worker/src/bin/fix-member-attributes.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Uroš Marolt <uros@marolt.me>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
…ult (#3449) Signed-off-by: Uroš Marolt <uros@marolt.me> Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>

Changes proposed ✍️
What
copilot:summary
copilot:poem
Why
How
copilot:walkthrough
Checklist ✅
Feature,Improvement, orBug.Note
Medium Risk
Introduces a new batch script that updates persisted member
attributesin-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
defaultvalues are derived by only considering non-empty platform-specific values and by preserving existing non-emptydefaultvalues instead of deleting the attribute when no platform source exists.Adds a
fix-member-attributesworker script to backfill members whose attribute objects have emptydefaultvalues despite having non-empty platform values; it batches through affected members, recomputes defaults viaMemberAttributeService, and preserves manually-changed attributes based onmanuallyChangedFieldsbefore writing updates.Cleans up member creation/update call paths to use
PlatformTypeconsistently (incl.MemberAttributeService.validateAttributesparameter order andActivityServicemember creation metadata typing).Written by Cursor Bugbot for commit 8775bd9. This will update automatically on new commits. Configure here.