Skip to content

feat: [MP-2469] - use setMyKivaGoal mutation on GoalData composable#6676

Closed
cristhianDt wants to merge 17 commits intomainfrom
feature/mp-2469-Repository-to-Use-setMyKivaGoal-Mutation
Closed

feat: [MP-2469] - use setMyKivaGoal mutation on GoalData composable#6676
cristhianDt wants to merge 17 commits intomainfrom
feature/mp-2469-Repository-to-Use-setMyKivaGoal-Mutation

Conversation

@cristhianDt
Copy link
Copy Markdown
Contributor

MP-2469

  1. remove use of updateUserPreferences mutation on GoalData composable
  2. use new setMyKivaGoal mutation
  3. update unit tests

https://kiva.atlassian.net/browse/MP-2469

@cristhianDt cristhianDt requested a review from a team February 24, 2026 03:23
@cristhianDt cristhianDt added the b2c Sends B2C team a message in Slack on PR creation label Feb 24, 2026
Comment thread src/util/userPreferenceUtils.js Outdated
Comment thread src/composables/useGoalData.js
Comment thread src/composables/useGoalData.js Outdated
Comment thread src/util/userPreferenceUtils.js Outdated
Comment thread test/unit/specs/composables/useGoalData.spec.js Outdated
Copy link
Copy Markdown
Collaborator

@dyersituations dyersituations left a comment

Choose a reason for hiding this comment

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

Marking this as blocked while we investigate other data sync options.

@cristhianDt cristhianDt marked this pull request as draft February 24, 2026 17:24
@dyersituations
Copy link
Copy Markdown
Collaborator

@cristhianDt I see this is still marked as draft and has some unresolved comment threads. Please take a look at those threads and reopen + re-request a review from the team when it's stable.

@cristhianDt
Copy link
Copy Markdown
Contributor Author

@cristhianDt I see this is still marked as draft and has some unresolved comment threads. Please take a look at those threads and reopen + re-request a review from the team when it's stable.

yeah, I'm on it, thanks for moving back to draft 👍

Comment thread src/composables/useGoalData.js
@cristhianDt
Copy link
Copy Markdown
Contributor Author

@dyersituations I think this PR is ready for review, I tagged christian to continue talking about his comments, there is just one question for you > #6676 (comment)

@cristhianDt cristhianDt marked this pull request as ready for review March 11, 2026 15:03
Copy link
Copy Markdown
Collaborator

@dyersituations dyersituations left a comment

Choose a reason for hiding this comment

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

See comments, especially around still including support for delete case, where we can just remove from the user preferences.

Comment thread src/components/GoalSetting/GoalSettingContainer.vue Outdated
Comment thread src/components/GoalSetting/GoalSettingContainer.vue Outdated
Comment thread src/components/MyKiva/LendingStats.vue Outdated
Comment thread src/components/Thanks/ThanksPageSingleVersion.vue
Comment thread src/composables/useGoalData.js Outdated
Comment thread src/util/userPreferenceUtils.js
Comment thread src/util/userPreferenceUtils.js Outdated
Copy link
Copy Markdown
Collaborator

@dyersituations dyersituations left a comment

Choose a reason for hiding this comment

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

See comment about upsert.

Copy link
Copy Markdown
Collaborator

@dyersituations dyersituations left a comment

Choose a reason for hiding this comment

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

Some minor improvements remaining.

await updateCurrentGoal(userGoal.value, preferences);
await recalculateGoalInformation();
try {
await updateCurrentGoal(userGoal.value, preferences);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This method uses updateUserPreferences which already has a try catch, so this try catch likely won't be hit. Should we remove?

Comment thread src/components/MyKiva/LendingStats.vue Outdated
await this.storeGoalPreferences(preferences, updateLocalState);
}
} catch (error) {
const msg = this.isUpdatingGoal ? 'updating' : 'setting up';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This message will now likely not be triggered for the update path, consider moving the try catch into the else above, since that's where the upsert is being called.

Comment thread src/util/userPreferenceUtils.js Outdated
Comment thread src/util/userPreferenceUtils.js Outdated
Co-authored-by: Cristhian Torres <30540297+cristhianDt@users.noreply.github.com>
* @param {string} goalData.status The goal status
* @returns The result of the mutation
*/
export const setMyKivaGoal = async (apollo, {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are some new issues when compared with dev:

  1. Go to MyKiva without goal
  2. Create goal via modal
  3. Set goal confirmation in modal is lacking progress already towards goal
Image
  1. Close the modal
  2. The goal card on MyKiva is not showing an active goal until the page is refreshed
Image

@cristhianDt
Copy link
Copy Markdown
Contributor Author

@dyersituations recent changes added a lot of conflicts in this branch so I decided closing this one and open a new one

@cristhianDt cristhianDt deleted the feature/mp-2469-Repository-to-Use-setMyKivaGoal-Mutation branch March 24, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

b2c Sends B2C team a message in Slack on PR creation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants