Cross references to footnotes are not updated when inserting a new footnote with a lower number

EDIT===

By pressing F9 or using menu Tools > Update > Fields, the references are correctly updated.

=====

EDIT===

Created bug report: https://bugs.documentfoundation.org/show_bug.cgi?id=118459

=====

(NOTE: I’m running LibreOffice v5.4.6.2, but also tested in LO 6.0.4.2.)

I have noticed that cross references to footnotes are not updated when I insert a new footnote with a lower number. Let me explain this scenario.

I start with a document with three lines:

This is the first line
This is the second line
This is the third line

Then I do these steps:

  1. I insert a footnote on the second line, with text “Footnote A”
  2. I insert a cross-reference to that footnote on the third line and format the number as superscript.

After this, I have the following text (NOTE: I use the caret ^ to depict a superscript)

This is the first line 
This is the second line ^1
This is the third line ^1

And at the bottom of the page, I have this footnote:

1 Footnote A

Good, so far. Now I want to put a footnote on the first line, with text “Footnote B”. Then, I get:

This is the first line ^1
This is the second line ^2
This is the third line ^1

As you can see, the third line’s cross reference is not updated. At the bottom of the page I have the expected footnotes:

1 Footnote B
2 Footnote A

Why isn’t the cross reference on the third line updated?

Thank you

thank you for bug report

Looks like a bug. I confirm unexpected behaviour even after Tools>Update>Update All. Tested with LO 5.3.7.2 (this is what is installed on the present computer).

Rechecked after @Regina’s edit: I inadvertently chose the wrong kind of reference, which was not obvious on a single page test. Tools>Update>Update all needed to trigger update.

No bug. Apologies for not checking context thoroughly.

For me it is only an update problem. Press key F9 or use menu Tools > Update > Fields works for me, LO 6.2 on Windows 10. If update does not work for you, are you sure you had “Reference” and not “Page” or others chosen in the Reference dialog?

Indeed, @ajlittoz 's comment, asserting that even with updating all the problem wasn’t fixed, confused me. My fault for not checking that for myself. I’m going to edit my post and my bug request. Thank you.