Wow I can't believe it has been over a month since I first tried switching to Holster in an existing application. It's just what it needed though, as it brought up all sorts of edge cases and timing issues that I hadn't thought of. The end result is that Holster now feels usable! This is a 1.0 release because multiple breaking API changes were required.
The biggest change is to the user API, which I mentioned needed fixing in the last update. It actually needed a complete redesign so that calling holster.user() returns a usable API and can also be used to fetch user data on other accounts. It now does this by taking an optional array of two values when making a query, so if you log in and try user.get("key") you will get your own data, and user.get(["other-account", "key"]) will get data on another account and not interfere with your current log in status.
The other API change is to holster.on(), which now takes four parameters. Previously it was only given a lex object and a callback, but I found a lot of situations where I wanted to add a listener and get the current copy of the data at the same time. So the third parameter is a boolean to get the data, and the fourth parameter is the same options object passed to get() to update the wait time if required.
Another API change is that user.recall() previously required a flag to specify if credentials are stored in local storage or session storage, now it just tries both so no flag is required.
As well as this there are a lot of updates that make it feel like a solid 1.0 release.
Verification is now done properly on user nodes, previously it would sign an update which didn't always contain all properties on a node. Now it will fetch the node first if required to make sure it signs everything. Signing and verification also need to be performed on the exact same object, so it sorts the keys to guarantee the same output.
When I started the port I noticed GunDB was doing a lot more wire sends than Holster, I now see how that helps to keep data in sync. It also means the in-memory graph is always up to date, so get requests now don't need to go to disk unless there's been a restart.
This felt like a lot of debugging to get this release out, but looking at the changes being committed it's far from a complete overhaul to how it was originally written! Hopefully this means it's close to being reliable. Next goal is to push the update to rsstream.app and see how it performs over the next few weeks.
Holster 0.3.0
I'm still in the process of converting an app from GunDB to Holster, and haven't hit too many hurdles so far. Enough changes are required to Holster for another release though, so I'm publishing version 0.3.0 as there's a small API change.
The main change required at this point is fixing user queries, I previously added holster.user(public-key) as a way to query other accounts, but it overwrites the context of a logged in user so I think I've fixed that.
I also updated the per-query options object that allows you to wait longer for data to be returned if required. It was available in the wire spec API but wasn't exposed to the Holster API, so get() and next() now both have an optional fourth parameter after the callback.
The last change is to support projects using webpack, which didn't like some Node imports in Holster. They should be ignored anyway so adding /*webpackIgnore: true*/ to the imports seems to work for that.
Holster 1.0
The biggest change is to the user API, which I mentioned needed fixing in the last update. It actually needed a complete redesign so that calling
holster.user()
returns a usable API and can also be used to fetch user data on other accounts. It now does this by taking an optional array of two values when making a query, so if you log in and tryuser.get("key")
you will get your own data, anduser.get(["other-account", "key"])
will get data on another account and not interfere with your current log in status.The other API change is to
holster.on()
, which now takes four parameters. Previously it was only given a lex object and a callback, but I found a lot of situations where I wanted to add a listener and get the current copy of the data at the same time. So the third parameter is a boolean to get the data, and the fourth parameter is the same options object passed toget()
to update the wait time if required.Another API change is that
user.recall()
previously required a flag to specify if credentials are stored in local storage or session storage, now it just tries both so no flag is required.As well as this there are a lot of updates that make it feel like a solid 1.0 release.
Verification is now done properly on user nodes, previously it would sign an update which didn't always contain all properties on a node. Now it will fetch the node first if required to make sure it signs everything. Signing and verification also need to be performed on the exact same object, so it sorts the keys to guarantee the same output.
When I started the port I noticed GunDB was doing a lot more wire sends than Holster, I now see how that helps to keep data in sync. It also means the in-memory graph is always up to date, so get requests now don't need to go to disk unless there's been a restart.
This felt like a lot of debugging to get this release out, but looking at the changes being committed it's far from a complete overhaul to how it was originally written! Hopefully this means it's close to being reliable. Next goal is to push the update to rsstream.app and see how it performs over the next few weeks.
Holster 0.3.0
The main change required at this point is fixing user queries, I previously added
holster.user(public-key)
as a way to query other accounts, but it overwrites the context of a logged in user so I think I've fixed that.I also updated the per-query options object that allows you to wait longer for data to be returned if required. It was available in the wire spec API but wasn't exposed to the Holster API, so
get()
andnext()
now both have an optional fourth parameter after the callback.The last change is to support projects using webpack, which didn't like some Node imports in Holster. They should be ignored anyway so adding
/*webpackIgnore: true*/
to the imports seems to work for that.