-
Notifications
You must be signed in to change notification settings - Fork 35
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
Refactor Rapid integration to load the editor in an iframe #2403
Conversation
cf52452
to
7e8a885
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2403 +/- ##
==========================================
+ Coverage 23.95% 24.02% +0.07%
==========================================
Files 649 650 +1
Lines 22483 22406 -77
Branches 6894 6888 -6
==========================================
- Hits 5385 5384 -1
+ Misses 14312 14254 -58
+ Partials 2786 2768 -18 ☔ View full report in Codecov by Sentry. |
7e8a885
to
8914a73
Compare
Following up on the TODOs I wrote in the initial post:
I tried this but it would require changes to our webpack config which we can't make without 'ejecting' from create react app, so I don't think it's worth worrying about.
In retrospect this was silly, what we want to do is use the access token for the current MapRoulette user, since that means they don't have to log into OSM twice (once in MR and again in the Rapid iframe). This is what the old code was doing, I just hadn't read it carefully enough. With those two things resolved, I think this is ready for review. |
Tested this against the staging server backend, using the following
Everything seems to work, including:
|
This prevents a new entry from being pushed onto the browser's history stack.
c78e0e1
to
18d9840
Compare
Should also resolve: |
Collin and I tracked down the source of a bug in this branch which caused Rapid not to select the OSM element specified in the MR task when it loaded. We only observed this bug when running a local development backend, but not when running the frontend against staging.maproulette.org. The selection bug was actually just a side effect; the root cause was that Rapid was failing to authenticate (preauth) to the OSM API server. When this happens it fires an Rapid was failing to auth when MapRoulette was running against the I've modified this PR to hopefully make this mistake harder to make in the future.
|
This is now deployed to staging and seems to be working correctly. The root cause of the issue Collin described in Slack was ultimately caused by Cloudflare rewriting |
LGTM |
This implements @bhousel's suggestion to mount Rapid in an iframe rather than directly into the main document tree. This has a few advantages:
rapid@2
as specified in the CDN URL in thepublic/rapid-editor.html
file; see the diff).One drawback worth noting is that since Rapid is now being loaded from a CDN, if the CDN is down, Rapid won't load, even if the MapRoulette servers are up and running. However, the jsDelivr CDN has an excellent track record.
This is a draft. I have a couple of tasks before I put this up for proper review:
public/rapid-editor.html
as part of the build stepFixes #2368