Skip to content

Commit

Permalink
fix: Fix clearing of one-time-completion manual self-report assessmen…
Browse files Browse the repository at this point in the history
…ts from notification (M2-8144, M2-8160) (#889)

* fix: normalize manual self-report targetSubjectID

When tapping a notification to start a manual self-report assessment,
the `targetSubjectId` was not being normalized to `null` as is done
elsewhere in the app. Fixed this at the `NotificationBuilder` step.

* chore: bump build #
  • Loading branch information
farmerpaul authored Nov 1, 2024
1 parent ce1c323 commit 8e6a21f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ android {
applicationId "lab.childmindinstitute.data"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1594
versionCode 1595
versionName "2.5.0"
resValue "string", "app_name", "Mindlogger"
resValue "string", "build_config_package", "lab.childmindinstitute.data"
Expand Down
24 changes: 12 additions & 12 deletions ios/MindloggerMobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1667,7 +1667,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1594;
CURRENT_PROJECT_VERSION = 1595;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
Expand Down Expand Up @@ -1698,7 +1698,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1594;
CURRENT_PROJECT_VERSION = 1595;
INFOPLIST_FILE = MindloggerMobileTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -1728,7 +1728,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1594;
CURRENT_PROJECT_VERSION = 1595;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -1769,7 +1769,7 @@
CODE_SIGN_ENTITLEMENTS = MindloggerMobile/MindloggerMobileRelease.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1594;
CURRENT_PROJECT_VERSION = 1595;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
INFOPLIST_FILE = MindloggerMobile/Info.plist;
Expand Down Expand Up @@ -1979,7 +1979,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1594;
CURRENT_PROJECT_VERSION = 1595;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -2019,7 +2019,7 @@
CODE_SIGN_ENTITLEMENTS = MindloggerMobileDevRelease.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1594;
CURRENT_PROJECT_VERSION = 1595;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
INFOPLIST_FILE = "MindloggerMobile dev-Info.plist";
Expand Down Expand Up @@ -2058,7 +2058,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1594;
CURRENT_PROJECT_VERSION = 1595;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -2099,7 +2099,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1594;
CURRENT_PROJECT_VERSION = 1595;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
INFOPLIST_FILE = "MindloggerMobile qa-Info.plist";
Expand Down Expand Up @@ -2136,7 +2136,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = MindloggerMobileStagingDebug.entitlements;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1594;
CURRENT_PROJECT_VERSION = 1595;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -2176,7 +2176,7 @@
CODE_SIGN_ENTITLEMENTS = MindloggerMobileStagingRelease.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1594;
CURRENT_PROJECT_VERSION = 1595;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
INFOPLIST_FILE = "MindloggerMobile staging-Info.plist";
Expand Down Expand Up @@ -2215,7 +2215,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1594;
CURRENT_PROJECT_VERSION = 1595;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -2256,7 +2256,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1594;
CURRENT_PROJECT_VERSION = 1595;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
INFOPLIST_FILE = "MindloggerMobile uat-Info.plist";
Expand Down
10 changes: 9 additions & 1 deletion src/entities/notification/model/factory/NotificationBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,18 @@ export class NotificationBuilder implements INotificationBuilder {

for (const eventEntity of this.eventEntities) {
try {
const { assignment } = eventEntity;

// Normalize target subject ID to null for self-reports
const targetSubjectId =
assignment && assignment.target.id !== assignment.respondent.id
? assignment.target.id
: null;

const eventNotifications = this.processEvent(
eventEntity.event,
eventEntity.entity,
eventEntity.assignment?.target.id || null,
targetSubjectId,
);
eventNotificationsResult.push(eventNotifications);
} catch (error) {
Expand Down

0 comments on commit 8e6a21f

Please sign in to comment.