In my app, at a moment where I know the user is connected to the internet, the user can load some data. This is stored locally in a collection and subsequently displayed in a gallery. The user can then click gallery items to select them and perform operations etc. However, since recently, I'm running into some issues...
I will illustrate how I set this up technically as it's really easy to set this up to demonstrate. (I'm using 'Accounts' datasource in this example -- but in reality I'm working with another custom entity)
In an action, for example in the OnSelect code of a button, load some data:
Clear(local_accounts);
ForAll( FirstN( Accounts, 3 ),
Collect( local_accounts, {
guid: Account,
locName: 'Account Name',
locAddr: 'Address 1: City' & " (" & 'Address 1: ZIP/Postal Code' & ")"
});
);
Load this data into a gallery, and set its OnSelect action to Set( selected_account, Gallery2.Selected );
This is where the trouble recently seems to have started, where it wasn't an issue before. As I said, I allow some data to be changed locally (so I can patch it back in a later moment). For example, I would do something like this:
// determine a new value
UpdateContext( { new_val : "["&Now()&"]" } );
// update the record in the local collection
Patch( local_accounts, selected_account, { locAddr: new_val } );
// also update the variable to reflect the new values
Set( selected_account, Patch( selected_account, { locAddr: new_val }) );
This would properly perform all updates (locally). But now, instead of patching the selected record in the local_accounts collection, the Patch command instead adds a new entry in the local_accounts collection that is empty except for the 'locAddr' column.
Am I off the rails here? Or is this a bug? As I said, up until recently, this method worked perfectly fine. I did notice that the "Selected" property of the gallery now seems to include some columns that are actually UI elements, that I never noticed before:

But I don't know if that's got something to do with it...