Lua stability on Android Mobile Client

Hi, this is a problem I am experiencing constantly recently on my Google Pixel 9 (with android beta). The silverbullet system randomly fallback to the case where the following functions are down:

  1. the mobile toolbar setting is not functioning, the menu fallback to the default style
  2. search file doesn’t work. The search has some of the content inside but not all
  3. all lua widget returns all lua error: attempting to index a nil value.

Note that all the problems described above happens simultaneously when the system goes wrong. This seems to me that sometimes the system on android browser ( I’ve tested on the firefox and the chrome) can’t reliably operates.

Note that reload both system and system ui several times can’t help you escape this problematic status, nor can it be guaranteed that a client that works previously fine would fall into such problem after a restart or a reload.

This is deeply troublesome as it decreases my trust on the silverbullet android client alot.

I am happy to provide more information upon request. But the whole problem seems to be that lua interpreter or something else can’t reliably work on android browsers. I wanna ask if anyone face the similar problem as well and if you have solution/intuition on the source of the problem.

When you say “constantly” what does that mean?

You’re using SilverBullet and all of a sudden it breaks? Does this happen when you reload SilverBullet or load it from “the code” (it probably wasn’t still running)? Does this happen after upgrading SilverBullet on the server, or even when no updates have happened? Is this in any way linked to Internet connectivity?

Constantly means two cases:

  1. when I start from a new android client. The client will be in this fallback mode 90% of the time when I start it.
  2. After a reload of the client, there is a very large chance that the client would into this fallback mode. This is not as strictly reproducible as the first case, and I also don’t know when it will be triggered as well as how can I get rid of this fallback.

Previously, I was suspecting that some of my Lua code was not running properly, but right now I’ve already resolved all the problem I previously observed on my Lua snippets. Also the fact that it works properly on the PC clients, there’s no reason I should suspect on my custom Lua code.

What I find to be more similar is the mode that you have mentioned to allow people to edit the silver bullets pages when the client is not fully synced yet. But in my case my client has been definitely fully synchronized and randomly fall back into this mode: 1) The toolbar is the minimalist default, and 2) all the Lua functionality as well as button query are not functioning, 3) nor are searching functionality.

Now go back to your questions:

  1. I am certain that the internet connectivity is not the issue, since I can also trigger a synchronization in this case.
  2. It’s not necessarily connected to a SilverBullet server upgrade, rather it happens randomly but very often.

I’d really like to see what’s happening in the JavaScript console, but I don’t know if you have some way to access it. What you can try is setting SB_LOG_PUSH=1 on your server, this should result in client logs (not everything, but a lot) to be sent to the server so you can maybe see what’s going on in these cases by looking at the server logs.

Nothing happens. Even though all the widgets and buttons on that client is still lua error: attempting to index nil value, it still doesn’t emit any error message to the server with SB_LOG_PUSH=1. It just have all the normal requests of file and write of file logs.

However, this time the newly created client works after a few reloads.

The only error I got from the console would be only git:

Running shell command: git [ "add", "./*" ]
Running shell command: git [ "commit", "-a", "-m", "Snapshot" ]
Requested file index.md
Running shell command: git [ "pull" ]
Error running shell command  There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=<remote>/<branch> master


Running shell command: git [ "push" ]
Error running shell command  fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

Which I suspect has nothing to do with our problem.

I’ll keep the push log variable there and try to observe if there is any other log happening later.

The only thing I did differently this time is I upgraded to the latest v2 this time and also simultaneously wipe the android client (and also log out). Which might be the reason why it works this time. Not sure if it would happen again so I’ll update here if that ever happens.

Overall I think it is such a mysterious problem.