@koolbase/js 11.1.0 → 11.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,44 @@ is based on [Keep a Changelog][kac], and this project adheres to
7
7
  [kac]: https://keepachangelog.com/en/1.1.0/
8
8
  [semver]: https://semver.org/
9
9
 
10
+ ## 11.2.0
11
+
12
+ ### Fixed
13
+
14
+ - **A function that timed out was indistinguishable from one that threw.** A
15
+ 504 fell into the generic 5xx branch and arrived as
16
+ `FunctionExecutionError`. Those need different answers — a timeout means
17
+ retry, raise the function's timeout at deploy, or move the slow part
18
+ elsewhere; an exception means fix the code. The server has always told them
19
+ apart. Now `FunctionTimeoutError`, and 429 gets `FunctionRateLimitError`
20
+ rather than falling through untyped.
21
+
22
+ - **`upload_expired` and `cap_below_usage` were unmapped in storage.** The
23
+ first matters: a presigned upload URL has a lifetime, and a user who picks a
24
+ file, gets distracted and confirms twenty minutes later hit it as a generic
25
+ failure. It is a retry, not a failure — presign again and send the same
26
+ bytes. Now `KoolbaseUploadExpiredError`.
27
+
28
+ - **Four database codes were unmapped**: `ambiguous_match`,
29
+ `constraint_exists`, `constraint_not_found`, `insufficient_authority`. The
30
+ first is the one an app hits — an upsert whose filter matched more than one
31
+ record is refused rather than resolved, because picking one would be a
32
+ silent guess about which row the caller meant.
33
+
34
+ - **Errors report the code the server sent, not their category.**
35
+ `KoolbaseNotFoundError` and `KoolbaseValidationError` each hardcoded one
36
+ code while being used for several, so a `collection_not_found` response
37
+ produced an error reporting `not_found`. Catching the class works as
38
+ before; reading `e.code` now gives the server's answer.
39
+
40
+ ### Why these were missing
41
+
42
+ The API writes error codes through four different helpers, so no single
43
+ search finds them all — which is how twenty-two codes across four surfaces
44
+ went unmapped without anyone noticing. Each surface now has a test asserting
45
+ every known code maps to its own class, so a new one added without a case
46
+ here fails the build rather than a user's upload.
47
+
10
48
  ## 11.1.0
11
49
 
12
50
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koolbase/js",
3
- "version": "11.1.0",
3
+ "version": "11.2.0",
4
4
  "description": "Koolbase SDK for the browser \u2014 auth, database, storage, realtime, functions, flags and offline sync in one package.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "url": "https://github.com/koolbase/koolbase-react-native"
26
26
  },
27
27
  "dependencies": {
28
- "@koolbase/core": "11.1.0"
28
+ "@koolbase/core": "11.2.0"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"