Skip to content

Releases: earthstar-project/earthstar

v6.3.5 - Bugfixes

09 Mar 19:20
Compare
Choose a tag to compare

#84 : Syncer2 bugfixes

When storage closes, close the syncer2.
Add a test for syncer2 closing when storage closes.
Add logging to syncer2 closing.
Only send change events from syncer2 when the state has actually changed.

Fixes #81 "OnePubOneWorkspaceSyncer should close itself when the Storage closes"


#85 : Upgrade some dependencies

v6.3.4 - fix missing export of Log functions

06 Mar 05:24
Compare
Choose a tag to compare

Now you can set the log levels as described in the previous release.

v6.3.3: revert 6.3.2 and increase logging around storage closing

06 Mar 05:11
Compare
Choose a tag to compare

Reverts the change from 6.3.2 -- now we again allow StorageIsClosed errors to propagate out of the OnePubOneWorkspaceSyncer again, instead of catching them in the syncer. Now we can investigate the root causes of those errors:

Added more logging to Storages, especially around their close() activities, so we can debug this. Run this in your Earthstar app to enable extra logs:

import { setLogLevels } from 'earthstar';

// 0: error, 1: warn, 2: log, 3: debug
setLogLevels({
    sync: 2,
    syncer2: 2,
    storage: 2,
    _other: 2
});

Made tests run faster and more reliably by allowing them to run in parallel and increasing their timeout, hopefully fixing random test failures in Github CI.

v6.3.2: Catch some errors when syncing

05 Mar 22:25
Compare
Choose a tag to compare

This small fix to the syncing code prevents StorageIsClosedError from being thrown if a network connection is slow to close and its data callbacks happen to run after a Storage is closed.

PR #80

v6.3.1

24 Feb 22:34
Compare
Choose a tag to compare

Small fixes for async storage support

From PR #79 :

  1. Add deleteMyDocumentsAsync() as a friend to the existing deleteMyDocuments() function. Identical except it works on async storages instead of synchronous storages.

  2. Fix Typescript type forOnePubOneWorkspaceSyncer to allow it to accept an async storage in the constructor, a leftover piece of related changes from v6.3.0.

v6.3.0

23 Feb 22:55
Compare
Choose a tag to compare

No breaking changes.

Big thanks to @sgwilym for this release!

Support for async storage in various synchronization functions

Terminology note: in this release notes, "async/sync" is about how functions return and "synchronization" is about trading data with other Earthstar peers.

We're adding support for async backends throughout Earthstar. The old storage classes were called IStorage and the new ones are IStorageAsync.

We've had a history of several classes that do data synchronization between Earthstar peers: Syncer1 and OnePubOneWorkspaceSyncer. These now accept IStorageAsync as well as IStorage instances. The synchronization classes had async APIs anyway since they dealt with the network, so nothing externally visible has changed about them.

In the process we fixed a bug and made synchronization more efficient.

Diff: ca12365?branch=ca12365a86223ac4aed74ceb2a7d8c0c4b899053&diff=unified

Better logging

There's a new log system with more control over the detail level for different kinds of logs.

Details in src/util/log.ts:

// Logs are assigned a priority number.
// Higher numbers are less important information.
// Set your desired log level higher to get more info.
// -1 shows nothing.
// 0 only shows errors.
// 1 also shows warnings.
// 2 also shows logs.
// 3 also shows debugs.

// Logs also come from different "sources" which can
// have different log level settings.

// Two ways to modify the log level settings:
//
// 1. Set an environment variable in the shell.
//    This applies to all "sources" (can't be set individually)
//         EARTHSTAR_LOG_LEVEL=2 npm run test
//
// 2. Use setLogLevels() to globally modify the levels:
//         setLogLevels({ sync: 2 });
//
// The environment variable wins over the numbers set by setLogLevels.

setLogLevels is a global singleton. You can use it from app code as well:

import { setLogLevels } from 'earthstar'

setLogLevels({ sync: 2 });

v6.2.1: query bugfix

18 Feb 19:36
Compare
Choose a tag to compare

This is just a bugfix for:

If you had a query in which history was set to undefined instead of just missing, the default history value of latest was not applied.

This was filed in issue #68 and fixed in PR #70. Read those for details.

Now query objects will allow any values to be undefined and will treat them as if they are not present in the query object.

v6.2.0: Asterisk is no longer allowed in Earthstar paths

16 Feb 22:14
Compare
Choose a tag to compare

Breaking change!

Continuing the trend, version 6 is going to be a series of breaking changes in each minor version. We have a lot of things to break :)

No more asterisks in paths

Asterisks * have been removed from the allowed characters in Earthstar paths.

Asterisks are allowed in regular web URLs. They are so tempting to use as query operators on paths, like /blog/posts/*.json, that I want to reserve them for that purpose and avoid them as part of regular Earthstar paths.

@RangerMauve and I are exploring this in earthstar-fetch as part of Agregore Browser.

For lists of allowed and disallowed characters, see the Paths section of the specification, and the Disallowed Path Characters section.

While researching this I noticed that the only other url-safe character that's excluded from Earthstar paths is semicolon ;. That means your could use semicolons in URLs to separate Earthstar paths, like, hypothetically: earthstar://+gardening.abc/blog/123.json;/comment/9842.json, 🤷‍♀️ if you wanted to.

Impact

I'm not aware of anyone using asterisks in their Earthstar paths. If anyone was, those documents will now count as "invalid" and will not sync between peers.

This is a serious breaking change that we can only make because not many people are using Earthstar yet.

v6.1.0: Changed spelling of query options

14 Feb 01:06
Compare
Choose a tag to compare

I've renamed the query options for easier understanding and to follow standard CamelCasing. This is a breaking change if you're using queries.

src/storage/query.ts

pathPrefix --> pathStartsWith
pathSuffix --> pathEndsWith

timestamp_gt --> timestampGt
timestamp_lt --> timestampLt

contentLength_gt --> contentLengthGt
contentLength_lt --> contentLengthLt

No other changes.

This probably should have been a major version according to semantic versioning, but there are a lot of big changes coming in version 6 so consider version 6 to be... full of surprises. We'll go to version 7 when things settle down.

v6.0.0

12 Feb 01:26
Compare
Choose a tag to compare

v6.0.0 🎉

This is almost the same as v6.0.0-beta.3, but not a beta anymore.

What's new in version 6? --> read v6.0.0-beta.1. There are breaking changes, so read carefully.

Also changed:

  • Added the deleteMyDocuments function which was also released in v5.7.6

  • Have not yet added the pathSuffix query option from v5.8.0 -- that's coming next.

Related packages

Other packages like react-earthstar, earthstar-cli, and earthstar-pub are not updated yet and will not be updated until the next minor version of v6.

Compatibility notes

As described in the v6.0.0-beta.1 notes, the changes are all in the Javascript API and the internal implementation. The network protocol, etc are unchanged.

  • Javascript API: minor changes
  • SQLite schema: unchanged, but now it contains a schema version of 1
  • Document format: unchanged
  • HTTP pub syncing: unchanged, will interoperate with v5 pubs