Rich Text Editor "caches" value when switching between entries with empty and filled values

TL;DR

When switching from Thing A with a filled field to Thing B with an empty field Rich Text Input “caches” the value of the Thing A’s field.

Issue description

I have a Repeating Group with a list of users and a separate group to show selected user details. Some text fields within my User data type are optional (for example, info or notes). These optional fields are displayed (and can be edited) in Rich Text Input elements.

So today I was editing User A with filled info field and right after that (without page reload) I made some changes to User B with empty info field. After saving User B data changes I’ve noticed that his empty info field was populate with User A’s info value.
After checking my DB I was “happy” to find out that there were a lot of users with duplicated info values, so I had to clean them up…

Investigation

While debugging I’ve discovered that despite the fact that Rich Text Input was visually empty (initial content = empty) - the value it kept was not empty:

After spending almost the whole day on struggling with this issue I’ve found out that this issue occurs when three conditions are met simultaneously:

  1. Rich Text Element is wrapped into a parent Group
  2. Rich Text Element references parent Group in the data source (Parent Group's thing)
  3. Rich Text Element should be visible on the page (if it’s hidden - you’ll not be able to reproduce the bug)

Workaround

During test performing I’ve found out that as soon as your Rich Text Element doesn’t reference it’s Parent Group's thing - you are safe. So you are free to reference a custom state or some VAR group (group that is used just to store variables).

P.S.

I’ve created a quick demo app where you can check this issue. To reproduce the issue you need to follow the sequence of user selecting:

User test2@test.com has empty info field.
Use Inspect function of the debugger to check Rich Text Elements values.

Demo app setup
  • Database:

  • Elements:

    • Rich Text Input #1:
      • wrapped into a Group A (group’s type of content = User)
      • initial content = Parent's group's User's info
        Screenshot 2023-11-30 at 01.17.27
    • Rich Text Input #2:
      • wrapped into a Group B (group’s type of content is not determined as by default)
      • initial content = Group VAR's User's info (so it references an external group, not the parent)
        Screenshot 2023-11-30 at 01.30.49
    • Group VAR:
      • group’s type of content = User
      • data source = empty
    • Repeating group Users: used for selecting user to be displayed in Rich Text Inputs
  • Workflow: single WF that triggers on user’s email click (in RG User), consists of 2 actions:

    1. Display data: current cell's user in Group A
    2. Display data: current cell's user in Group VAR
2 Likes

@ihsanzainal84 I’ve seen your topic about this problem, but it has been automatically closed by forum bot. You mentioned that a bug report has been submitted. Has Bubble support team clarified you something about it?

Support had a 50/50 chance of reproducing it but last I checked it’s still an issue with the latest version. It started happening after a specific version of it, i can’t remember which one though.

Something new I did notice some time ago is this happens when the RTE is in repeating groups. I could be wrong, or totally forgot about it, but it’s not an issue otherwise.

1 Like

@artemzheg This has been a problem since the RTE was introduced. I can vaguely remember sending in a Bug report about in late 2019 or early 2020.

2 Likes

That’s interesting. I’ve found just a couple of topics where this issue is mentioned on the forum, all of them are created in 2023. For a plug-in with almost 240k installs it is suspicious.
I wonder why. Either just small amount of devs wrap RTE into a group and reference it in the data source or they tested it poorly like me before discovering it :slight_smile:

I checked RTE reviews and here is what I was looking for:

So I randomly played with RTE plug-in versions::

RTE plug-in version Caching issue exists
2.1.1 (latest) :heavy_check_mark:
2.0.6 :heavy_check_mark:
2.0.3 :heavy_check_mark:
2.0.2 :heavy_multiplication_x:
2.0.0 :heavy_multiplication_x:
1.2.0 :heavy_multiplication_x:
1.1.0 :heavy_check_mark:
1.0.0 :heavy_multiplication_x:

Due to test results - caching issue error first appeared in version 1.1.0 and was fixed in 1.2.0.
And the second coming of it happened in version 2.0.3 and it’s still here with us :slight_smile:

1 Like

Hi @artemzheg thanks for the reference and clear explanation! After some testing i found out the scenario you stated is indeed true.

When saving data from the RTE to a database item the issue still occurs eventhough the ‘value’ of the RTE states as EMPTY in the debugger.

At this moment i added a workflow that ‘when the input of the RTE changes…’ the custom state gets updated with the value. Then wen saving the record to the database i save the value in the custom state. This does resolve the issue for now!

1 Like

Small update.
Bubble support is aware of this bug and plans to resolve it in future release of Rich Text Editor plug-in.

1 Like

Let’s hope they don’t break it again in the update after :grin:

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.