Skip to content

v0.6.0

Latest

Choose a tag to compare

@ghostdogpr ghostdogpr released this 05 Nov 07:05
· 3 commits to main since this release
4700aec

Release Notes

This release adds an in-memory client for tests and support for servers that only speak RESP2.

  • In-memory client for tests. sage-testkit provides InMemorySageClient, a SageClient that needs no Redis server, for every backend. Code that takes a SageClient can be tested with it unchanged. See Testing.

    def visit(client: SageClient, page: String) = client.incr(s"visits:$page")
    
    test("counts visits") {
      val client = InMemorySageClient()
      for {
        _     <- visit(client, "home")
        count <- visit(client, "home")
      } yield assertTrue(count == 2L)
    }
  • RESP2 fallback. When a server rejects HELLO 3, Sage now continues with RESP2, so it can connect to Redis before 6.0 and to RESP2-only proxies. The new SageConfig.protocol setting controls this. See Protocol version.

  • Bug fixes. On Valkey, JSON length and key queries on a missing key no longer fail to decode. The direct backend no longer risks a stack overflow in some recursive loops.

  • Binary compatibility. The new SageConfig field breaks binary compatibility with 0.5.0. Source compatibility is kept.

What's Changed

  • Add an in-memory client for tests that need no Redis server by @ghostdogpr in #282
  • Fall back to RESP2 when RESP3 is unavailable by @ghostdogpr in #284