Comment on attachment 472206
Adds force-refresh flag to calICSCalendar
This solution is much simpler than what I imagined, but I'm not sure its the right way to go:
You're lucky that adding the argument to refresh actually works. The calICalendar interface doesn't specify any arguments, but since JS is forgiving w.r.t passing arguments and you're not crossing any xpcom boundaries here makes it work out. If in some case the call to savedthis.refresh() does pass xpcom boundaries, I believe the extra |true| argument will be stripped.
Aside from that, it seems not to be working for me:
STR:
* Create a calendar on a file://.../test.ics calendar
* Remove write access (i.e chmod -w ~/test.ics)
* Write an event on the calendar
Results:
* I get a message that writing failed, but the event is still there
>- refresh: function calICSCalendar_refresh() {
>+ refresh: function calICSCalendar_refresh(aForce) {
>+ this.forceRefresh = aForce;
> this.queue.push({action: 'refresh'});
> this.processQueue();
> },
If we do use the forceRefresh() flag, then maybe we could pass aForce as a further object parameter to the {action: 'refresh'} object. This way there's no chance of re-entrancy issues in the future.
Comment on attachment 472206
Adds force-refresh flag to calICSCalendar
This solution is much simpler than what I imagined, but I'm not sure its the right way to go:
You're lucky that adding the argument to refresh actually works. The calICalendar interface doesn't specify any arguments, but since JS is forgiving w.r.t passing arguments and you're not crossing any xpcom boundaries here makes it work out. If in some case the call to savedthis.refresh() does pass xpcom boundaries, I believe the extra |true| argument will be stripped.
Aside from that, it seems not to be working for me:
STR:
* Create a calendar on a file://.../test.ics calendar
* Remove write access (i.e chmod -w ~/test.ics)
* Write an event on the calendar
Results:
* I get a message that writing failed, but the event is still there
>
> mObserver: null,
> locked: false,
>+ forceRefresh: false,
>- refresh: function calICSCalendar_ refresh( ) { refresh( aForce) { push({action: 'refresh'}); ue();
>+ refresh: function calICSCalendar_
>+ this.forceRefresh = aForce;
> this.queue.
> this.processQue
> },
If we do use the forceRefresh() flag, then maybe we could pass aForce as a further object parameter to the {action: 'refresh'} object. This way there's no chance of re-entrancy issues in the future.
r- to clarify