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

Revert incorrect handling of FAILURE status (fetch job statuses) #99

Merged
merged 1 commit into from
Dec 13, 2020

Conversation

ross-spencer
Copy link
Contributor

@ross-spencer ross-spencer commented Dec 3, 2020

FAILURE handling was added incorrectly to package_list_task_status.
This commit reverts those changes to make the console output work
as it did previously. This also quietens down the completed tasks
alerts as well.

Resolves #72
Resolves #73

@peterVG first, apologies for my speaking out of term the other day. I had diagnosed this wrong. Looking again tonight I have discovered a mis-reading of the original JavaScript functions you had created when I changed them here: e59056e#diff-606a3136c88e560ab867ae3abac4c67013a7a577f7b69878f20c7939fa99e179. I have not tried to add FAILURE handling in again as this might be something you do differently with your current work, and so this just reverts the change back to a working JavaScript. If you have an opportunity to test and review we'll get this merged and it should be one less annoyance 🙂

Recorded tonight:

Peek 2020-12-02 23-07

@ross-spencer ross-spencer requested a review from peterVG December 3, 2020 04:09
@ross-spencer ross-spencer changed the title Revert incorrect handling of FAILURE status Revert incorrect handling of FAILURE status (fetch job statuses) Dec 3, 2020
$.ajax({
type: 'GET',
url: '/aggregator/package_list_task_status/' + taskId,
datatype: "json",
success: function(data) {
state = data['state']
if (state != status_pending && state != status_progress && state != status_failure) {
state = data['state'];
Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to initialize state with let state = .... Otherwise I think loose mode JS will make this a global variable and strict mode will throw an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yep. Language switching failings.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah no worries, that happens!

Copy link
Contributor

@tw4l tw4l left a comment

Choose a reason for hiding this comment

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

LGTM! Code changes make sense and I'm seeing the expected UI behaviour on my end.

image

tasks.py could benefit from some linting (I see missing semi-colons in places not touched by your changes in these commits, for instance) but I think touching that up might be out of scope for this PR, so I'm approving as-is.

FAILURE handling was added incorrectly to package_list_task_status.
This commit reverts those changes to make the console output work
as it did previously. This also quietens down the completed tasks
alerts as well.
@ross-spencer ross-spencer force-pushed the dev/issue-73-correct-console-issues branch from ec0f739 to 39dbf88 Compare December 13, 2020 23:24
@ross-spencer ross-spencer merged commit 39dbf88 into main Dec 13, 2020
@ross-spencer ross-spencer deleted the dev/issue-73-correct-console-issues branch December 13, 2020 23:37
@ross-spencer
Copy link
Contributor Author

Thanks @tw4l! Glad to have this fixed. I've logged two extra issues around JavaScript and also related to your suggestions for fontawesome as well. Primary one for JS is: #103 if you have any favorite linters/experience then it would be great to get your feedback there too. I just quickly tried on or two tonight - eslint didn't like being run on my machine! JSlint seems older? But it got the job done as a demonstration. Anyhoo!

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