FLOPPY: Plugin for localStorage, sessionStorage, IndexedDB storage, List Creation/Manipulation, Iteration, and More! Now with even more video docs!

UPDATE TIME: As I noted a couple of days ago, when using IndexedDB/localForage as the storage option, some of Floppy’s actions would not behave in a synchronous way. I’ve just pushed version 1.7.0, which I believe fixes this problem for all actions that claim to be synchronous in their documentation.

Several other bugs were also fixed in the process.

This was a pretty big set of changes, and it’s possible that there are issues with this new version. As always, do let me know here in the thread if you run into any errors or weird behavior. (And, should you find issues that block you, just go back to version 1.6.10 until I get you a fix.)

Expect ongoing regular updates to Floppy (not just bug fixes, but new features) as we’re just getting started.

Happy bubbling,
Keith

2 Likes

I just want to share a little bit about my tracking syncing of storage across reusable elements.

I have my header (reusable) Floppies syncing storage and a page or other reusable accessing those same keys using Floppy Reader.

I just added a new date field in User that will update whenever storage has been updated and use that (match against a date state in the page/reusable) to trigger any Floppy Reader to update (and update that date state so it restarts the trigger).

Hope that helps fellow Floppy users!

1 Like

Hey @ihsanzainal84, that’s a pretty good idea and I’m glad you found a solution that works for your use case!

I had thought about perhaps adding “system fields” to objects stored by Floppy (e.g., metadata like modified date), but chose to leave the interface as close to the basic session/localStorage interface as possible, at least for the first versions.

That’s something I still might add as an option. The main issue with adding stuff like that is — if we want to expose that metadata — we end up with a bunch of additional outputs since Bubble doesn’t let us expose objects (except for Things) at a plugin’s outputs.

(And, actually, I do have a plugin that does this, but I started to hate the interface and decided that a stripped down version — basically Floppy — was more generally useful.)

The issue with their being no support for local/in-page objects is really vexing and limits what we can do with the plugin API.

3 Likes

I don’t know if it can give you any ideas for future updates but I decided to use floppy with bdk’s environment variable plugin. Gaurav’s plugin has a field that keeps the data in sync and can trigger workflows on changes. (and the behavior between reusables is just fantastic)

For me, since I was already using that plugin a lot, the mix of both is just perfect. (again : for me)

Only thing I’m wishing (but you pretty much answered that it aint possible) is the ability some day to use API objects in these plugins… Would be a game changer for many of us. But hey… Let’s not make such important/obvious functions (variables, api things, json parsing, etc.) built-in to bubble and just find workarounds “sad face”.

1 Like

Cool cool. I don’t really know how/what Gaurav’s env variables plugin does (probably writes values in the window object?) but glad to hear these play well together.

Very few Bubblers (at least from what I observe) creatively use plugins (or plugins and vanilla Bubble features) together. But there’s a lot of cool stuff you can do in that way!

As for the API thing: I’ll do a video demonstrating how to cache and recover an API response in Floppy. While you can’t just shove an API response object into Floppy (because it’s not serializable/stringifiable) you can store the raw response (as text which you can then recover by calling your own app’s API). And any list of normal-datatype fields from a response (or a scalar field) can be stored there,

1 Like

I think I spotted a bug in Stepping. When building my stepping workflow, the type of Thing attached to a Floppy’s Step is the Floppy’s key type instead of the Thing assigned to the Floppy’s Step Mode List Type.

I can set the right Thing list in the action STEP: Begin Stepping. I just keep getting the wrong Thing being referenced when trying to retrieve the Floppy element’s Step Item or Step List.

One more thing @keith, not sure what’s happening but I have a custom event that triggers a STEP: Begin Stepping action but the step trigger (and any subsequent) doesn’t look like it’s happening.

In console this is what it says:
Floppy Warning: Stepping is already active, but the Begin Stepping action was called. Use the End Stepping action to prematurely end Step mode.

Note: my Step action includes calling another Floppy to add a list of values to that Floppy’s RAM list + update storage.

Hi @ihsanzainal84 - you are correct. The type of the exposed states for Step Entire List and Step Item were set to be Floppy’s main type instead of “Step Mode List Type”. D’oh!

This is fixed in version 1.7.2, which I just pushed.

There are a couple of not-optimal things in Step Mode that I just noticed and I’m fixing them. However, if you get that warning “Stepping mode is already active”, that means that you did, in fact, Begin Stepping on some Floppy and then executed Begin Stepping on it again (the Floppy is already in step mode so, Begin Stepping won’t have any effect in this case). Unfortunately, this message could be being sent by ANY Floppy in your page and I can’t tell them apart at runtime. I could add some additional info like what keys the Floppy is reading, or it’s type of values or something to help tell them apart.

Anyway, there are a couple of fixes/improvements coming to Step Mode very shortly.

1 Like

@keith thanks for your reply.

I am now using the latest version 1.7.2 and still getting the same error. Its show up on the home screen itself without log-in.

This is my sample JSON structure Inventory JSON

This is my workflow

This is how I am using it at Design Page. I have highlighted the same in your favorite Hot Pink color. Both Inventory and SalesOrder have similar issues.

@packetu can you point me to your page? It might be helpful if you could give me access to your editor as well. Feel free to private message me with details if you don’t want to share them in the forum post. Thanks!

YEP, MORE UPDATES!: Just pushed version 1.7.4 of Floppy which fixes some edge case stuff with Step Mode and adds enhanced Step Mode debug messages (console log messages that Floppy will write to the console if you set Debug Mode to “yes” in the Begin Stepping action). Additionally, in that action, you can give those messages a unique name for your Floppy, just in case you have multiple Floppies that might be doing Step Mode (<- @ihsanzainal84 you may find this helpful)

Here’s the new section of the Begin Stepping Action:

1 Like

Hi @keith! Here’s an update on this issue.

So what I finally figured out (and is reproducible) is that the Floppy Stepper bugs out when I put a Search For as the List to Step.

The stepper works when I put the Search For into a state first, then point List to Step to that state, or if Bubble has already done a search for the list of items somewhere else in the page.

Seems like a bug? Hope this helps!

Now I need a smoke.

1 Like

Hey @ihsanzainal84 , thank you for your very detailed bug reports. It does seem odd to me that the behavior you are describing would happen, but perhaps I have something stupid going on with the Begin Step action. (It’s odd because I have what’s basically a canonical function for reading lists and it’s very solid and when I fetch the list-to-step, I just call that function to get it and we should be golden.)

But, given what you’ve told me, surely I can find and fix the issue. (And yes, if things are behaving the way you say – and I have little doubt that they do – this is just a silly bug and I’ll fix it.)

It sounds like you’ve been thrashing to figure out a way to reproduce the problem and I greatly appreciate your efforts. If you’d like one of my other commercial plugins like CG Pro or Parallels, just PM me the id (name) of the Bubble app you’d like me to install it in and I will grant it to you for free. (Or, you can just save the positive karma balance you have generated to redeem for a future commercial plugin.)

Many thanks,
Keith

Edit: Oh… do you find this behavior with the latest version? Just checking.

Thanks for the karma but being able to support a plugin that i find useful is enough for me.

Yep I’m using the latest version.

1 Like

Cool. Cool. This will probably be fixed tomorrow (it’s 9:43 PM here, so I’m drinking and smoking and doing no more code for the day). :slight_smile:

2 Likes

Hey @ihsanzainal84, I’m unable to duplicate the issue you’re having where setting List to Step to a Search for… doesn’t work. What sort of data type is your list in these cases? Could you point me to a page in your editor which exhibits this issue? I basically need to see what’s happening to be able to fix this for you. (Feel free to private message me that info.)

Hey there, @promax7! I just pushed an update to Floppy that makes the drag/sortable repeating group feature work in the new responsive engine.

I haven’t spent too much time with the new engine and so didn’t know that the structure of RGs is slightly different than in the “classic” engine. The new version (1.7.5) of Floppy now works with RGs in either the “old style” pages, or in new responsive pages. :tada:

UPDATE TIME: As noted in my previous post seconds ago, Floppy version 1.7.5 is now available. This update makes the drag-and-drop items in a repeating group feature (found in Floppy’s main interface under ADVANCED: SORTABLE RG OPTIONS) work under the “new responsive” engine. So now Floppy works with RGs regardless of whether you’re using the “old” engine or the “new” one. Hooray!

For an explanation of how to use this feature, check out this video:

Hi @keith!

The setup is very simple, I pretty much followed the example in your Stepping demo sans the next and previous actions.

That’s all I’ve setup in my workflows for this test and below is the UI;

I added my reusable elements that contain other Floppies to test if that affected anything (they don’t thankfully).

So the Search for Tags text element is what i use to get Bubble to retrieve the tag list, this let’s the Floppy to Step normally.

If I were to delete that text element, I don’t have anything else retrieving the tag list, then the Floppy Stepper bugs out.

The Tag list is just a simple data type setup as such:

The enquiryFor field will never have more than 10 Users in it at any one time.

EDIT: Wanted to add that I have a conditional that disables the Start button until the Floppy initializes.

Hey, @keith!
Thanks for great plugin! I`m trying to use your plugin to speed up my development and app performance.
I think i found a bug. Here is console error:

run.js:8 autorun.run_once timeout
        at https://rolder-app-development.bubbleapps.io/package/run_js/3986600ee8b6be05c7cc74e5dd58a78d061e979b3c8bdfef3906c45f853dba24/xfalse/x18/run.js:8:1477641
        at i (https://rolder-app-development.bubbleapps.io/package/run_js/3986600ee8b6be05c7cc74e5dd58a78d061e979b3c8bdfef3906c45f853dba24/xfalse/x18/run.js:8:1477766)

     {timeout_seconds: 60, fn_source: '()=>{r.ensure_ready(r.scheduled_key,!1),m().app_la…[t]=o.dehydrate_tree(null!=n?n:null))}},()=>e())}', waiting_on: 'Watcher is marked not ready but keys are turned. _debug_turned_key = undefined. IS SCHEDULED: true', code: '1666442163369x602273252069190700'}

It happens when browser tab with my app is not active. Chrome.