Custom Code Just Not Saving Reliably - Reopening

I originally opened the following issue but was not able to get back to it in time before it was auto closed:

Please review that short thread for context and the secure note you need to gain access to the specific site in question.

Now, to summarize the issue:

  1. I have a Raw Content element (or any element, that doesn’t matter) that uses a shortcode from a plugin to display a widget of some kind
  2. The Raw Content can not be previewed in the builder so I must view it in the front end
  3. I want to write some CSS for that widget
  4. I open the Custom Code editor and write some CSS that addresses my needs
  5. The builder can not show it to me so I load it in the front end
  6. I find that my CSS was not saved to the DB and therefore has no effect on the front end
  7. I prove this by reloading the builder and verifying that my new code has not been saved properly
  8. Try again and save frantically until the system decides to save it at arbitrary times

This situation has been happening to me a lot lately and it is unpredictable. @ruenel, I know you already went in there and tried to reproduce the problem but… if it decided to behave at that moment, you wont see it. I actually go into the same page you created to show you the problem in the very simple example of border colors and max-width.

I have made the video below to show it rather than explain it… it is much easier to understand it this way.

Please watch it in full to understand what I am talking about and see the issue happen several times intermittently.

Thank you for taking a thorough look at this because it is really in the way at this point… its been happening consistently enough that is is significantly slowing down my process almost every work day.

Thank you!

Hello @simeoned,

Thanks for reaching out.

Is this only happening when you quickly save the page using shortcuts such as Command + S on Mac or Ctrl + S on Windows? Does it happen when you use the mouse to manually click the save button? This is probably happening because there’s a short delay, around half a second, before the editor updates the actual value of the code editor. This delay or deferring function is added to prevent the editor from updating the page immediately while typing or using the keyboard. To avoid the issue, try to make your changes, wait at least a second or two before saving the page. This gives the editor time to update itself and sync the editor state.

Hope this helps.

Best regards,
Themeco

@Ismael,

Thank you for your response and the suggestion. However, the issue I’m experiencing with custom CSS not saving isn’t limited to using keyboard shortcuts like Command + S. As shown in the video I provided (e.g., at the 1:50–2:00 mark), I manually click the Save button after making changes, with more than a second’s delay, and the CSS still doesn’t save to the database. This is consistent whether I use shortcuts or the mouse, as demonstrated throughout the video.

I kindly ask that you review the full video, which clearly illustrates the intermittent nature of this issue across multiple attempts. The secure note with site access details is also included in my original post for further investigation.

This problem is significantly impacting my workflow, so I’d greatly appreciate a deeper look into what might be causing it. Please let me know if you or a colleague (@ruenel?, @charlie?) can investigate further or if there’s anything else I can do to assist.

Thank you for the update.

At that moment, you set the border to green, manually clicked the Save button, checked the page, and the changes were applied. Then you went back to the editor, changed it to blue, and immediately saved the page using the keyboard shortcut. That time, it didn’t work.

We created a test page in the probuiltwebsite and record a short video. You’ll notice that the changes only failed to apply when we try to switch the border color from purple to pink or black around 0:45 mark, then immediately save the page using the keyboard shortcode. You’ll also notice that when we switch from pink to black, then again immediately save using the shortcut, the border is still set to pink, not black. The reason for this is that the page update or save occurred even before the editor could change the state from pink to black. However, after that, when we make sure to wait for a few seconds before saving the update, the changes are consistently applied to the page. Please check the clip below.

The issue has been forwarded to our channel. We understand that this can be a bit inconvenient while working. For now, we recommend waiting a few seconds to make sure the states are synced or updated before clicking Save. We’ll continue to look into the issue.

Hmmmm… So you’re saying I am literally just working too fast? Man, I hope that’s true and I can just adjust my habits a bit and find relief from the issue.

lemme stress test this a bit and see if I can consistently replicate the issue under the conditions you describe. I’ll update the thread after I mess with this some more… Fingers crossed.

So after some playing around, I can confirm that saving very very quickly after an update to the code will consistently produce the problem. Fair enough.

However, here is what I have been doing when running into this issue the last few weeks before I reported it:

  1. Make a quick change to CSS
  2. Potentially save too quickly as described and notice my change not take effect in the front end
  3. Head back to the builder and click or shortcut to save again without making further changes, the new code is now there and, even though it didn’t save when I originally saved (because I went too fast), it has since had plenty of time to “settle in”,
  4. Click or shortcut save and reload in the front end to find the problem still persists and my changes still have not taken effect.

Now, to be fair, the scenario I am describing in those last 4 steps is not happening right now and your explanation makes total sense and I can consistently reproduce what you are describing.

But, I promise that over the last few weeks, I have definitely experienced the above 4 step scenario on multiple occasions. It’s just not happening consistently.

… Its weird. Please do keep your eyes on this in your internal discussions and I will make another video if I can find a way to demonstrate the phenomenon on my end.

Thank you for your work

Hey @simeoned,

In your test, please also include different web host or server environments because server performance can limit how fast you can work.

Let us know if you have consistenly replicated the issue.

Thanks.

Yes, I will. But honestly, I’ve been seeing the issue on multiple servers but the more I think about it, the more I think I just need to slow down a bit when saving as suggested.

Again, thank you so much for your work on this issue. I will let you know if I see anything that adds to this discussion but, I think I’m good for now.

You’we welcome @simeoned

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.