CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.89k stars 712 forks source link

Error on state change for tracked change #10634

Open eszkadev opened 1 day ago

eszkadev commented 1 day ago

Describe the Bug

There was an error in the online reported by user: image

But it still seemed to work.

Steps to reproduce

  1. open writer
  2. review tab -> activate "record"
  3. do some changes in document
  4. turn off "record"
  5. review tab -> "next" / "previous"

I quickly checked the code and it fils in: https://github.com/CollaboraOnline/online/blob/9663a3f75e992dbd09776ca52e46dd6192837cab/browser/src/map/handler/Map.StateChanges.js#L50

Interesting is that _annotation is not set enywhere. Quick grep shows:

browser/src/layer/tile/CanvasTileLayer.js:              if (this._annotations) {
browser/src/layer/tile/CanvasTileLayer.js:                      var annotations = this._annotations;
browser/src/layer/tile/CanvasTileLayer.js:              if (this._docType === 'spreadsheet' && this._annotations !== undefined) {
browser/src/map/Map.js:         if (this._docLayer && this._docLayer._annotations && this._docLayer._annotations._items) {
browser/src/map/Map.js:                 for (var idxAnno in this._docLayer._annotations._items) {
browser/src/map/Map.js:                         var annotation = this._docLayer._annotations._items[idxAnno];

I guess it should be replaced with proper get-section thing:

const annotations = app.sectionContainer.getSectionWithName(L.CSections.CommentList.name);
if (annotations) annotations.doSomething()

Probably we forgot to remove few usages of that _annotations ?

eszkadev commented 1 day ago

cc: @gokaysatir @lpranam you might know