Batch messages with version 1.3.30

You can now send batch messages and get all answers back at once. Will be used in Translate when each phrase require one call to LibreTranslate. When all phrases are translated we want to write a translation file.

The release on GitHub: https://github.com/peterlembke/infohub/releases/tag/v1.3.30

The release more in detail:

Added – new features

GMT time in tools

The Tools are actually demos that are somewhat useful. You can now get the GMT time.

  • HUB-1711, PHP/JS Added GMT as a time format you can ask for. You can test it with InfoHub Tools -> Time

Progress heart

The progress bar now got a heart that pulsate every time new data comes in. There is a new demo to show how it works.

  • HUB-1721, added beating heart to renderprogress that pulsate every time data is updated. The visible progress bar only update every second

Batch calls

You can now put together a lot of messages. Send them away. You get back one answer with all the answers. (If you use the helper).

You can also do a custom batch call where you get the answer for each message but the last message have a flag that it is the last one.

There is a Batch demo that show batch messages on client / server either custom or with helper. Normally the batch message answers are stored in Storage, but you can also store in memory. The demo show how.

Read more about batch messages in the documentation inside InfoHub.

  • HUB-1707, PHP – You can do a batch call and get a flag on the lastly returned message. See the Demo plugin.
  • HUB-1724, JS – You can do a batch call and get a flag on the lastly returned message. See the Demo plugin.
  • HUB-1707, PHP – Added a demo for the batch call in the Demo plugin.
  • HUB-1730, JS – Added a demo for the batch call in the Demo plugin.
  • HUB-1736, PHP/JS – infohub_batch – You now have a helper to send batch messages. See the Demo plugin “Batch”.
  • HUB-1737, JS/PHP – infohub_batch – data_back is now supported in batch messages.
  • HUB-1740, JS/PHP – infohub_batch – You can add data_back.sort_order (int). Sorts the data ascending.
  • HUB-1739, JS/PHP – infohub_batch – Added send_batch_messages_in_memory to send messages in memory. Use with few messages that require speed.

Delete after reading

You can now set a flag that the things you read from Storage should be returned to you and also deleted from Storage. This was a thing needed for batch messages to clean up the data after the lats message had read the data.

  • HUB-1725, PHP – infohub_storage – added support for delete_after_reading
  • HUB-1726, JS – infohub_storage – added support for delete_after_reading

Debugging

While coding the batch messages I messed up something in the InfoHub core and InfoHub did not start. It was a tough week to find the issue. One thing I did was to add more statistics to get a feel of what messages were processed by the core.

  • HUB-1741, JS – infohub_exchange – Added statistics how many messages were processed in each step in the main loop. Makes debugging the core slightly easier.

Changed – changes in existing functionality

This is developer sugar. Improved code quality. Support for PHP 8.2 with PHP 8.3 coming in the next release. Improved debugging in the browser.

  • HUB-1706, you can now download the login file for localhost
  • HUB-1723, infohub_base.php – declare some functions as private
  • HUB-1707, infohub_compress – Renamed uncompress -> decompress everywhere
  • HUB-1707, infohub_base.php – Refactored the cmd() function to have a more modern code style
  • HUB-1707, error box now got CSS to show properly in light and dark mode
  • HUB-1707, Changed double quotes to single quotes in PHP, where possible
  • HUB-1724, JS – Base Cmd(), Now aligned row by row with PHP Base Cmd()
  • HUB-1724, Support for PHP 8.2, minor changes in the code
  • HUB-1729, PHP Stan level 9 – fixed all issues
  • HUB-1741, JS – infohub_base, infohub_exchange – Added log level debug and corrected the log levels on all log messages. Makes debugging the core mush easier.

Removed – now removed features

The Storage in PHP support many types of servers. We have MySQL, SQLite, PostrgreSQL, soon Redis, MongoDb, KeyDb and more. In the browser we only have IndexedDb. There were no point in having the extra code layer for supporting more storages when there only exist one. It might come plugins to the browser that allow you to store to other database servers. If that become a thing then I dig diwn in git and restore this code.

  • HUB-1710, infohub_storage.js have for long merged with idb-keyval. Moved files to a backup folder and added a README

Fixed – bug fixes

You can specify what data you want back from a sub call or batch message with data_require. If the answer is normally very verbose you can ask to only get this and that. That reduces the message size and makes things quicker. data_require was a feature I introduced a decade ago but have not used much until I needed it now for batch messages and found that it needed some work to work.

  • HUB-1707, PHP _Default now add the key to answer if not existing instead of throwing an error
  • HUB-1730, infohub_doc_get.js – Bug when old document is still valid
  • HUB-1727, JS – data_request now works – You can specify what data you want back, see infohub_demo_batch for example
  • HUB-1736, PHP – data_request now works – You can specify what data you want back, see infohub_demo_batch for example
  • HUB-1736, PHP – from_plugin now works – You can now see what plugin the message came from
  • HUB-1741, JS – could not start – did not recognize the node: client
  • HUB-1743, Failure to start. HUB-1726 works, HUB-1727 does not. I removed changes in base and exchange. Now it works.

Challenges

This release have been challenging. We have moved. A complicated dragged out move over four months. And then five months renovating the new place. And working full time as a software developer. And training to be in some OK condition. I am a runner and like to participate in competitions.

Renovations are done enough for a summer break and I managed to find the time and stamina to complete this release.

Next releases

I will finish the last tasks for this current release v1.3.30

  • Get infohub.se working with the latest release v1.3.30
  • OK, Get the blog working
  • Write on X about the blog and the release

In the next release v1.3.40 I have this

  • Improve the README
  • Update all screen shots in the documentation. They are old and outdated.
  • Translations – Make the tool bug free. Now when batch messages work it is possible to call LibreTranslate with all phrases and get the answer back to write translation files.

And the release v1.3.45

  • Translation files for all plugins

Plans for Version 1.3.50

And then the plan is to work on the Three. The most important feature in InfoHub. In short it will sync data between client and server. Use single point encryption. It will help you write simple client plugins and not have to think about syncing data, data security and data backup.


End of document

Security – in case of vulnerabilities

  • HUB-1704, Improved message: Server says: Package sign_code_created_at is older than 4.0 seconds. Check your computer clock

Investigated

  • HUB-1738, Batch Require data_request – Not possible. The function do not have access to the data_request parameter.

Things I have looked into.

  • MongoDb – Support for the Storage plugin will come. I have worked a lot with MongoDb.
  • Lottie animation files – Interesting
  • MongoDb Geo location data – Interesting
  • Turtle Graphics rendered by the SVG plugin – Might come later. Great for measuring up apartments.
  • A-frame – VR/AR – Might come later.
  • Audio sprites – This will come. Probably with Three.js or another code I have.
  • Notification API – Have done labs and it works well
  • PHP 8.3 – I have looked into it. It will be supported soon. Might already work.
  • Passkeys – Investigated how to make a passkey system. It will come in the future. I have no working lab yet.