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

Follow-up fixes to synchronous editing #1097

Open
jywarren opened this issue Oct 18, 2019 · 4 comments
Open

Follow-up fixes to synchronous editing #1097

jywarren opened this issue Oct 18, 2019 · 4 comments

Comments

@jywarren
Copy link
Member

Noting some suggested fixes/next steps to get synchronous editing working, from this comment by @sashadev-sky -- #959 (comment)

Live synchronous editing will not work I am fairly sure. The code itself has a lot of bugs and it throws errors. Also a lot of code smells, it recopied the code in Map.js that was there before I updated it here.

Mainly, heres the most problematic part:

$.ajax('/images/' + img.warpable_id, { // send save request
type: 'PATCH',
data: {
warpable_id: img.warpable_id,
locked: (img.editing._mode == 'lock'),
points:
img.getCorner(0).lng + ',' + img.getCorner(0).lat + ':' +
img.getCorner(1).lng + ',' + img.getCorner(1).lat + ':' +
img.getCorner(3).lng + ',' + img.getCorner(3).lat + ':' +
img.getCorner(2).lng + ',' + img.getCorner(2).lat,
},
beforeSend: function (e) {
$('.mk-save').removeClass('fa-check-circle fa-times-circle fa-green fa-red').addClass('fa-spinner fa-spin')
},
success: function(data) {
App.concurrent_editing.speak(data);
},

The data parameter passed to the success function is always just going to be "success". Then in later functions this parameter is assumed to be a warpable.

If i were to try to fix this, how would I test synchronous editing? Not familiar with how this works

To illustrate how it is supposed to work, check out this comment by @ViditChitkara !

#805 (comment)

and #957

Here's an in-progress GIF -- some bugs with it have already been fixed, but it shows how to test the system:

@jywarren
Copy link
Member Author

jywarren commented Dec 6, 2019

Hi @ViditChitkara do you think you could go through this and check on Sasha's suggestions? I'll work with Sebastian on the server side of things so let's just be sure this all works as expected in any edge cases!

@ViditChitkara
Copy link
Member

That's great---will have to recall somethings related to this. Will get back on this!!

@ViditChitkara
Copy link
Member

Left some comments on #959 . Let's see.

@ViditChitkara
Copy link
Member

any suggestions here would be very helpful @publiclab/reviewers

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

No branches or pull requests

4 participants