Open Ashod opened 3 years ago
@moodlebeuth, @grabs, if you can take a look at this tiny improvement, would be great.
After we merge #20 I will throw an error with the server name stating that it's currently unavailable. But for now, at least we don't show XML errors, which are unhelpful.
Merging #25 into master will decrease coverage by
0.55%
. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #25 +/- ##
============================================
- Coverage 14.02% 13.46% -0.56%
- Complexity 137 144 +7
============================================
Files 17 17
Lines 699 728 +29
============================================
Hits 98 98
- Misses 601 630 +29
Impacted Files | Coverage Δ | Complexity Δ | |
---|---|---|---|
moodle/mod/collabora/classes/collabora.php | 32.57% <0.00%> (-4.93%) |
66.00% <0.00%> (+7.00%) |
:arrow_down: |
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 fc22536...c243323. Read the comment docs.
Merging #25 into master will decrease coverage by
0.55%
. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #25 +/- ##
============================================
- Coverage 14.02% 13.46% -0.56%
- Complexity 137 144 +7
============================================
Files 17 17
Lines 699 728 +29
============================================
Hits 98 98
- Misses 601 630 +29
Impacted Files | Coverage Δ | Complexity Δ | |
---|---|---|---|
moodle/mod/collabora/classes/collabora.php | 32.57% <0.00%> (-4.93%) |
66.00% <0.00%> (+7.00%) |
:arrow_down: |
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 fc22536...c243323. Read the comment docs.
Hi Ashod,
sorry for the long delay. Thank you for this request! I looked into it but unfortunately I couldn't get it work as expected :(. The problem here is that the plugin uses the moodle cache to get the discovery_xml which you try to check. So if the plugin has established the connection once the xml always is loaded from cache until the cache is purged. I don't know whether or not the cache is needed. On my dev system the discovery xml is loaded in nearly no time. For me there are to possible ways to go with this: 1) You don't use the cache and load the discovery xml each time a user opens a document 2) You only check the base url and check for an "ok" in it. This should be sufficient too. What do you think?
Best regards Andreas
This prevents xml parsing errors when the server is not avialable. In a follow-up patch we will throw a 'server unavailable' error to better communicate the issue.