meeting-room-booking-system / mrbs-code

MRBS application code
Other
124 stars 61 forks source link

Missing events from .ics report #2564

Open jberanek opened 4 years ago

jberanek commented 4 years ago

We've recently updated from 1.4.11 to 1.7.3. Ever since the upgrade, some events are missing in iCalendar reports which are present in both CSV and HTML reports. I have not as yet been able to discern any pattern to the missing events, but I've been examining the raw .ics file to confirm they're really missing and the issue not an artefact of the tool into which the file is then imported. Any help you can give me to track this down will be much appreciated.

Reported by: madhatter0

Original Ticket: mrbs/support-requests/1865

jberanek commented 4 years ago

I assume you are not using periods in any of your areas? Periods aren't converted into iCalendar events because MRBS doesn't know when periods start and end.

Original comment by: campbell-m

jberanek commented 4 years ago

Interesting. We noticed the "excluding periods" warning on the report generation form, but weren't sure if it meant "no full stops, US-style". How can I be sure that an appointment which is missing isn't using periods?

Original comment by: madhatter0

jberanek commented 4 years ago

Well, an area either uses periods or times. So you should get all the events from areas wich use times and none from areas which use periods.

Original comment by: campbell-m

jberanek commented 4 years ago

Thanks, that's very clear. We don't use periods anywhere. I'm loooking at two appointments, in the same area at around the same time, both time-based, each a member of its own series, on subsequent days, one of which reliably doesn't get into the .ics file, and the other of which does.

Original comment by: madhatter0

jberanek commented 4 years ago

And are you sure that the one that doesn't get in isn't actually in there as part of a series? Have you tried importing the .ics file into eg Outlook or Google calendar to check whether it's there?

Original comment by: campbell-m

jberanek commented 4 years ago

Fairly sure, yes. It was the import that originally tipped us off to the problem; only after I was shown imports that didn't have all the appointments in (both in Outlook and Evolution) did I start looking into the raw .ics file, to try to increase certainty that it wasn't some other tool's import logic that was the problem.

Original comment by: madhatter0

jberanek commented 4 years ago

I have found a bug in the iCalendar reports and am working on a fix. Whether it's the same bug that you're seeing I don't know yet.

Original comment by: campbell-m

jberanek commented 4 years ago

Happy to test any kind of fix you might come up with, both to confirm that it doesn't break anything new, and to find out whether or not it fixes my bug. Thanks!

Original comment by: madhatter0

jberanek commented 4 years ago

Thanks. Having looked at the code, there were quite a few bugs in it and I've rewritten it. Could you try this version of functions_ical.inc please? If it works I'll tidy it up and commit it to Mercurial.

Original comment by: campbell-m

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/901a0a74fa/ee62/attachment/functions_ical.inc

jberanek commented 4 years ago

Thank you so much! Initial results are promising: the specific appointment that was missing from the .ics report is now in. I've asked the church office to test this over the next couple of days and will provide feedback as soon as I'm given some.

Original comment by: madhatter0

jberanek commented 4 years ago

I've now committed the fix to Mercurial. I look forward to receiving any more feedback from your testing.

Original comment by: campbell-m

jberanek commented 4 years ago

Just a technical note for those that are interested. I think the reason why it stopped working when you upgraded from 1.4.11 to 1.7.3 is that between those two releases the database abstraction layer in MRBS was changed from using the mysql_ functions to PDO. Unfortunately the code for exporting events relied on being able to select particular rows from a database query and this worked in 1.4.11 using mysql_data_seek() but doesn't work in 1.7.3 using PDO - and I'm not sure that PDO is capable of supporting it, at least for MySQL.

I have rewritten the export code in functions_ical.inc so that it doesn't need to seek particular rows, and just processes the rows in the order in which they appear. This fixes the problem you were seeing, though there were some other bugs which I fixed as well. However there's still the problem about what to do about the new database abstraction layer. I have raised this as a separate bug report at https://sourceforge.net/p/mrbs/bugs/445/.

Original comment by: campbell-m

jberanek commented 4 years ago

Initial reports are that it's much better but not yet perfect. I've asked for details of searches that miss appointments so that I can reproduce them on demand.

Original comment by: madhatter0

jberanek commented 4 years ago

Thanks. Yes, I'd be interested in the details of missing appointments. If it helps narrow it down, then likely areas for things going wrong are in series, particularly

Original comment by: campbell-m

jberanek commented 4 years ago

I've found and fixed a bug. If the most recently created series in a report only had one event in the report window, then it wouldn't be included. I've restructured the code since the fix posted above so the best thing to do is to upgrade to the latest code in the mrbs_17_branch which you can get by following the "Download Snapshot" link on this page.

Original comment by: campbell-m

jberanek commented 4 years ago

OK, I can run a report which is reliably missing an appointments in the middle of a week. It is a member of a series. It seems to be the third member of its series. I can't say if it is the most recent series established. Elements of the series have been deleted, though not the missing one.

Let me know if I can provide more information.

Original comment by: madhatter0

jberanek commented 4 years ago

Sorry, I think our previous comments crossed on the wire. I have now installed the snapshot version, and it's got rid of the issue I reported in my previous comment (which was in fact exactly as you described it). Many thanks! I have asked the church office to bash on the system some more, and give feedback.

Original comment by: madhatter0