status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.9k stars 987 forks source link

Malli Schema Errors Not Logged in Console After Schema Change #18176

Open ajayesivan opened 10 months ago

ajayesivan commented 10 months ago

Following a recent schema change, I've observed that Malli schema errors are no longer being logged in the console during development. Although the red warning box appears in the simulator UI, the corresponding errors fail to appear in the console logs. Interestingly, restarting the app resolves the issue.

cc: @ilmotta

ajayesivan commented 10 months ago

This error is turning out to be a positive force, pushing me to utilize the REPL more and more 🤭

ilmotta commented 10 months ago

Surprising finding, thanks for reporting @ajayesivan.

We use a custom malli.pretty/-printer and call malli.pretty/reporter to report errors, which in turn uses println for cljs. I would expect the terminal output to be the only true reliable output, the one on the UI should work too, but given it has other moving parts going on, a bug here and there wouldn't be as surprising.

That is to say, we have ways to find out what's going on.

If you spot this issue again, could you add the exact reproduction steps? That way I can help fix the problem.

This error is turning out to be a positive force, pushing me to utilize the REPL more and more 🤭

Lovely! One thing for REPL usage is to remember to call status-im2.setup.schema/setup! after evaluating expressions that change one or more function schemas, otherwise you will probably see outdated assertions. This is documented here https://github.com/status-im/status-mobile/blob/8a869be01c728de5a444741db0fadc4aa6f4f3f5/src/status_im2/setup/schema.cljs#L86-L89