apps 0.0.1-beta.123 → 0.0.1-beta.124

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.
package/js/host.js CHANGED
@@ -41,6 +41,7 @@ import {
41
41
  Cause_exports,
42
42
  Clock_exports,
43
43
  Effect_exports,
44
+ Option_exports,
44
45
  Redacted_exports,
45
46
  Scheduler_exports,
46
47
  Schema_exports
@@ -48,6 +49,21 @@ import {
48
49
  import "./chunk-CZ7CSFO4.js";
49
50
 
50
51
  // src/implementation/cache-session.ts
52
+ var refreshLimit = "30 seconds";
53
+ var refreshFailure = (cause) => {
54
+ if (Cause_exports.hasDies(cause)) return { "cache.refresh.failure": "defect" };
55
+ const error = Cause_exports.findErrorOption(cause);
56
+ if (Option_exports.isNone(error)) return { "cache.refresh.failure": "interrupted" };
57
+ if (Cause_exports.isTimeoutError(error.value)) return { "cache.refresh.failure": "timeout" };
58
+ if (Schema_exports.is(CacheError)(error.value))
59
+ return {
60
+ "cache.refresh.failure": "cache",
61
+ "cache.error.reason": error.value.reason,
62
+ ...error.value.limit === void 0 ? {} : { "cache.error.limit": error.value.limit }
63
+ };
64
+ if (Schema_exports.isSchemaError(error.value)) return { "cache.refresh.failure": "invalid-value" };
65
+ return { "cache.refresh.failure": "loader" };
66
+ };
51
67
  var isolatedCacheSession = (callback) => {
52
68
  const controller = new AbortController();
53
69
  const pending = /* @__PURE__ */ new Set();
@@ -69,8 +85,12 @@ var isolatedCacheSession = (callback) => {
69
85
  const services = yield* Effect_exports.context();
70
86
  const promise = Effect_exports.runPromiseWith(services)(
71
87
  task.pipe(
72
- Effect_exports.timeout("30 seconds"),
73
- Effect_exports.catchCause(() => Effect_exports.logWarning("App cache refresh failed"))
88
+ Effect_exports.timeout(refreshLimit),
89
+ Effect_exports.catchCause(
90
+ (cause) => Effect_exports.logWarning("App cache refresh failed").pipe(
91
+ Effect_exports.annotateLogs(refreshFailure(cause))
92
+ )
93
+ )
74
94
  ),
75
95
  { signal: controller.signal }
76
96
  ).then(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps",
3
- "version": "0.0.1-beta.123",
3
+ "version": "0.0.1-beta.124",
4
4
  "description": "TypeScript apps with typed tools, accounts, storage, and UI.",
5
5
  "type": "module",
6
6
  "sideEffects": false,