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

UI: Fix issue update race condition #6194

Merged
merged 11 commits into from
Feb 28, 2019
Merged

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Feb 26, 2019

#5980 introduced a race condition where location.reload would in some browers fire before the async ajax request in updateIssuesMeta to update a issue label was completed. Fixed this by letting updateIssuesMeta return a Promise and only executing the reload after all requests have finished.

Also introduced a shared reload function.

Fixes: #6191

@codecov-io
Copy link

codecov-io commented Feb 26, 2019

Codecov Report

Merging #6194 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6194      +/-   ##
==========================================
+ Coverage   38.86%   38.86%   +<.01%     
==========================================
  Files         354      354              
  Lines       50210    50210              
==========================================
+ Hits        19512    19516       +4     
+ Misses      27872    27867       -5     
- Partials     2826     2827       +1
Impacted Files Coverage Δ
models/repo_list.go 66.84% <0%> (-1.06%) ⬇️
routers/repo/view.go 42.07% <0%> (+0.99%) ⬆️
models/unit.go 14.28% <0%> (+14.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a2e92b...735ee0e. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 26, 2019
@silverwind silverwind changed the title fix issue update race condition JS: Fix issue update race condition Feb 26, 2019
@techknowlogick techknowlogick added type/bug topic/ui Change the appearance of the Gitea UI labels Feb 26, 2019
@techknowlogick techknowlogick added this to the 1.8.0 milestone Feb 26, 2019
@silverwind silverwind changed the title JS: Fix issue update race condition UI: Fix issue update race condition Feb 27, 2019
@zeripath
Copy link
Contributor

Hmm... Do we have a Promise library already installed for IE?

@silverwind
Copy link
Member Author

Hmm... Do we have a Promise library already installed for IE?

Yes, we do have a Promise polyfill, but it was so far only loaded when heatmap was enabled. Just fixed that so it is always loaded.

@silverwind
Copy link
Member Author

silverwind commented Feb 27, 2019

Replaced es6-promise with promise-polyfill. Not sure if the former does automatically polyfill window.Promise, but the latter one surely does. Testing IE now.

@silverwind
Copy link
Member Author

IE11 fixed and working, it actually choked on ES6 trailing commas, took me a while to realize.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 27, 2019
public/js/index.js Outdated Show resolved Hide resolved
Copy link
Member

@jolheiser jolheiser left a comment

Choose a reason for hiding this comment

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

Tested with Chrome, Firefox, and IE11 using @sapk checkout PR contrib, worked on all browsers.

@GiteaBot GiteaBot removed the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Feb 28, 2019
@GiteaBot GiteaBot added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Feb 28, 2019
@zeripath zeripath merged commit 8e266c3 into go-gitea:master Feb 28, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to set labels on issues
7 participants