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

[Proto] Tasks in /job proto don't update on initial configuration #1911

Closed
Tracked by #1758
sufyanAbbasi opened this issue Jul 16, 2024 · 4 comments · Fixed by #1923
Closed
Tracked by #1758

[Proto] Tasks in /job proto don't update on initial configuration #1911

sufyanAbbasi opened this issue Jul 16, 2024 · 4 comments · Fixed by #1923
Assignees
Labels
type: bug Something isn't working

Comments

@sufyanAbbasi
Copy link
Contributor

Describe the bug
Not all tasks are being converted to proto for some reason.

To Reproduce
Steps to reproduce the behavior:

  1. Sync repo to HEAD
  2. Run the local server with npm run start:local (localhost:5000)
  3. Create a new survey with all task types
  4. Check the Firebase emulator: http://localhost:4000/firestore/default/data/surveys/, see that the tasks under /jobs only have two entries and there are no task descriptions. Also see that the second entry has an index of -1, which is probably incorrect.

Expected behavior
There should be 9 task protos for each task type.

Screenshots
image
image

@sufyanAbbasi sufyanAbbasi added the type: bug Something isn't working label Jul 16, 2024
@gino-m
Copy link
Collaborator

gino-m commented Jul 17, 2024

@rfontanarosa PTAL?

@sufyanAbbasi
Copy link
Contributor Author

Ah, I think I have a picture for what's going on here... the trigger for updating /jobs is not happening when you hit "Continue" after the initial job configuration screen, it only triggers on survey title update because of the updateSurvey callback which does:

 await Promise.all(jobs.map(job => this.updateJob(surveyId, job)));

Or if we publish changes after an edit.

So in order to properly save the jobs in proto at the initial configuration, we have to trigger an updateSurvey when we hit Continue or something?

@sufyanAbbasi sufyanAbbasi changed the title [Proto] Tasks in Jobs are not being converted to proto properly [Proto] Tasks in /job proto don't update on initial configuration Jul 19, 2024
@gino-m
Copy link
Collaborator

gino-m commented Jul 19, 2024

Gentle ping @rfontanarosa

@sufyanAbbasi
Copy link
Contributor Author

I think I found the bug! On "Continue" we run saveTasks() which doesn't call updateJob() which does the routine to serialize the tasks to proto. Maybe we can pull that logic in there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants