Lots of sync issues today

Today, I'm repeatedly encountering errors in the app sync. AppSheet spins for a while saying "syncing the app", but then says there was an error and I should reload the browser tab where I'm developing. Similar issue occurs just trying to open the app on a mobile device. Any guidance?

Solved Solved
0 1 100
1 ACCEPTED SOLUTION

Think I figured this out.

For a few days now, I've been battling myriad issues while I develop my app--app preview mostly (but not always) wouldn't load, couldn't save after adding a new table, couldn't regenerate structure for an existing table. I think I finally isolated the issue to a problematic security filter--once I removed that expression altogether, things started working again. I'll post a new Q to seek assistance with what I was trying to accomplish.

In case it's helpful to anyone at AppSheets, here's that expression, which AppSheets didn't flag for me as problematic:

IF(OR(USEREMAIL() = CONTEXT(OwnerEmail), IN([Role], LIST("Admin", "Leader"))), OR([Tenant ID] = USERSETTINGS("Tenant ID"), AND([Email] = USEREMAIL(), [Active])), AND([Email] = USEREMAIL(), [Active]))

I see now some ways in which that expression doesn't make sense for a security filter. For comparison, here's how I tried to fix it. In this case, AppSheet provided the helpful error that it can't be self-referential (i.e., a security filter expression can't reference the table it's filtering).

OR(USEREMAIL() = CONTEXT(OwnerEmail), AND([Email] = USEREMAIL(), [Active]), IN([Tenant ID], SELECT(Users[Tenant ID], AND([Email] = USEREMAIL(), [Active], IN([Role], LIST("Admin", "Leader"))))))

View solution in original post

1 REPLY 1

Think I figured this out.

For a few days now, I've been battling myriad issues while I develop my app--app preview mostly (but not always) wouldn't load, couldn't save after adding a new table, couldn't regenerate structure for an existing table. I think I finally isolated the issue to a problematic security filter--once I removed that expression altogether, things started working again. I'll post a new Q to seek assistance with what I was trying to accomplish.

In case it's helpful to anyone at AppSheets, here's that expression, which AppSheets didn't flag for me as problematic:

IF(OR(USEREMAIL() = CONTEXT(OwnerEmail), IN([Role], LIST("Admin", "Leader"))), OR([Tenant ID] = USERSETTINGS("Tenant ID"), AND([Email] = USEREMAIL(), [Active])), AND([Email] = USEREMAIL(), [Active]))

I see now some ways in which that expression doesn't make sense for a security filter. For comparison, here's how I tried to fix it. In this case, AppSheet provided the helpful error that it can't be self-referential (i.e., a security filter expression can't reference the table it's filtering).

OR(USEREMAIL() = CONTEXT(OwnerEmail), AND([Email] = USEREMAIL(), [Active]), IN([Tenant ID], SELECT(Users[Tenant ID], AND([Email] = USEREMAIL(), [Active], IN([Role], LIST("Admin", "Leader"))))))
Top Labels in this Space