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

Terminate Field Slip Status Requests #2723

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JoeCohen
Copy link
Member

@JoeCohen JoeCohen commented Feb 18, 2025

  • Fixes how the js controller stops sending GET requests when the job is done.
  • Contains only one commit, authored by @Nimmo, (cherry picked from commit 70155d9) and effectively moved from InatImportJobTracker auto updates #2702 so that it can be considered separately.

(cherry picked from commit 70155d9)
@JoeCohen JoeCohen changed the title Terminater Field Slip Status Requests Terminate Field Slip Status Requests Feb 18, 2025
JoeCohen added a commit that referenced this pull request Feb 18, 2025
- These changes have been moved to a separate PR against main #2723
@mo-nathan
Copy link
Member

Looks reasonable to me. Wonder if we have any way to test it.

@JoeCohen
Copy link
Member Author

@nimmolo: Like @mo-nathan said here, I also don't understand what this fixes in Field Slips.
In main it stops sending GET "/field_slip_job_trackers" requests as soon as the Field Slip pdf is complete.

@JoeCohen JoeCohen marked this pull request as ready for review February 19, 2025 14:07
@nimmolo
Copy link
Contributor

nimmolo commented Feb 20, 2025

There must be something different about the Stimulus that I didn't notice when comparing to iNatImport Stimulus.

Oh i know. It's the difference between update and replace.

@nimmolo nimmolo closed this Feb 20, 2025
@nimmolo nimmolo reopened this Feb 20, 2025
@nimmolo
Copy link
Contributor

nimmolo commented Feb 20, 2025

Actually I do think this PR is still worth it, for two reasons.

  • It removes an inaccurate comment of mine about not calling this class methods within setInterval
  • It contains an improved code pattern (in the sense of usable in future templates) than the current version.

Currently the "pdf finished" code clears the interval and removes the name of the controller from the "data-stimulus" attribute, but does not actually disconnect the controller; that's handled in the disconnect function. I think the "pdf finished" code should simply clearInterval, this will create less confusion for future coders, including me!

@JoeCohen JoeCohen marked this pull request as draft February 21, 2025 02:53
@JoeCohen
Copy link
Member Author

JoeCohen commented Feb 21, 2025

@nimmolo.

  • Could you have another look at this. When I tested it manually, the tracker sent GET requests forever. And it appears (but probably isn't the case) that the job never finishes. (Perhaps I messed up the branch.)
Screenshot 2025-02-20 at 6 53 04 PM
  • Is there a way -- other than a system test -- to test this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants