Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Duplicates - Back button then forward button breaks it. #393

Closed
JosephGaynier opened this issue Jun 4, 2020 · 3 comments
Closed
Labels
bug Something isn't working frontend goal: MergeDup

Comments

@JosephGaynier
Copy link
Contributor

Steps to reproduce bug:

  1. Select Merge Duplicates
  2. Press the back button
  3. Press the forward button

No entries show up
Selecting Save and Continue with cause an error.

@JosephGaynier JosephGaynier added bug Something isn't working frontend labels Jun 4, 2020
@shyung18 shyung18 self-assigned this Jun 5, 2020
@shyung18 shyung18 assigned shyung18 and unassigned shyung18 Jun 18, 2020
@imnasnainaec
Copy link
Collaborator

See issues #456 #457 #458 for goal navigation refactoring.

@johnthagen
Copy link
Collaborator

Related bug I hit:

While testing this PR on master to try to reproduce, I created a project, added entries, created another project and switched to it, clicked review entries, and then hit the browser back button and I got this error in the browser:

Error
Unhandled Rejection (TypeError): Cannot read property 'goalType' of undefined
updateStepData
C:/Users/User/GitHub/TheCombine/src/components/GoalTimeline/GoalsActions.tsx:178
  175 | }
  176 | 
  177 | export function updateStepData(goal: Goal): Goal {
> 178 |   switch (goal.goalType) {
  179 |     case GoalType.MergeDups: {
  180 |       let currentGoalData: MergeDupData = JSON.parse(
  181 |         JSON.stringify(goal.data as MergeDupData)
View compiled
(anonymous function)
C:/Users/User/GitHub/TheCombine/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepActions.tsx:219
  216 |   state: GoalHistoryState
  217 | ): Promise<void> {
  218 |   return new Promise((resolve, reject) => {
> 219 |     let updatedGoal = updateStepData(goal);
  220 |     dispatch(updateGoal(updatedGoal));
  221 |     let indexInHistory: number = getIndexInHistory(state.history, goal);
  222 |     addStepToGoal(state.history[indexInHistory], indexInHistory);
View compiled
updateStep
C:/Users/User/GitHub/TheCombine/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepActions.tsx:218
  215 |   goal: Goal,
  216 |   state: GoalHistoryState
  217 | ): Promise<void> {
> 218 |   return new Promise((resolve, reject) => {
  219 |     let updatedGoal = updateStepData(goal);
  220 |     dispatch(updateGoal(updatedGoal));
  221 |     let indexInHistory: number = getIndexInHistory(state.history, goal);
View compiled
(anonymous function)
C:/Users/User/GitHub/TheCombine/src/goals/MergeDupGoal/MergeDupStep/MergeDupStepActions.tsx:195
  192 |    let goal: Goal = historyState.history[historyState.history.length - 1];
  193 | 
  194 |    // Push the current step into the history state and load the data.
> 195 |    await updateStep(dispatch, goal, historyState).then(() => {
      | ^  196 |      historyState = getState().goalsState.historyState;
  197 |      goal = historyState.history[historyState.history.length - 1];
  198 |      if (goal.currentStep < goal.numSteps) {
View compiled
▶ 2 stack frames were collapsed.
(anonymous function)
C:/Users/User/GitHub/TheCombine/src/components/GoalTimeline/GoalsActions.tsx:165
  162 |        goal.currentStep = 0;
  163 |        goal.steps = [];
  164 | 
> 165 |        await dispatch(refreshWords());
      | ^  166 | 
  167 |        break;
  168 |      case GoalType.CreateCharInv:

@imnasnainaec
Copy link
Collaborator

Resolved (probably in commits # 1004-1028).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend goal: MergeDup
Projects
None yet
Development

No branches or pull requests

4 participants