@solibo/solibo-react 1.58.0 → 1.58.1-feature-atomic-draft-save-17257f6-1795685259768-SNAPSHOT

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.
@@ -30,5 +30,6 @@ export declare const integratedRequestFingerprint: (value: unknown) => string;
30
30
  export declare const useIntegratedRetry: <C = undefined>() => {
31
31
  forget: () => void;
32
32
  heldFor: (request: string, files?: readonly unknown[]) => HeldIntegratedRetry<C> | undefined;
33
+ outcomeUnknown: boolean;
33
34
  run: <T>(attempt: IntegratedAttempt<C>, save: (idempotencyKey: string | undefined) => Promise<T>) => Promise<T>;
34
35
  };
@@ -1,5 +1,5 @@
1
1
  import { integratedRetryKey } from '@solibo/solibo-query';
2
- import { useCallback, useRef } from 'react';
2
+ import { useCallback, useRef, useState } from 'react';
3
3
  const sameFiles = (left, right) => left.length === right.length &&
4
4
  left.every((file, index) => file === right[index]);
5
5
  /**
@@ -17,6 +17,7 @@ export const integratedRequestFingerprint = (value) => JSON.stringify(value, (_k
17
17
  */
18
18
  export const useIntegratedRetry = () => {
19
19
  const held = useRef(undefined);
20
+ const [outcomeUnknown, setOutcomeUnknown] = useState(false);
20
21
  const heldFor = useCallback((request, files = []) => {
21
22
  const current = held.current;
22
23
  return current &&
@@ -34,6 +35,7 @@ export const useIntegratedRetry = () => {
34
35
  try {
35
36
  const result = await save(idempotencyKey);
36
37
  held.current = undefined;
38
+ setOutcomeUnknown(false);
37
39
  return result;
38
40
  }
39
41
  catch (error) {
@@ -46,11 +48,13 @@ export const useIntegratedRetry = () => {
46
48
  request: attempt.request,
47
49
  }
48
50
  : undefined;
51
+ setOutcomeUnknown(held.current !== undefined);
49
52
  throw error;
50
53
  }
51
54
  }, [heldFor]);
52
55
  const forget = useCallback(() => {
53
56
  held.current = undefined;
57
+ setOutcomeUnknown(false);
54
58
  }, []);
55
- return { forget, heldFor, run };
59
+ return { forget, heldFor, outcomeUnknown, run };
56
60
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Changes only a resident's email and phone; the SDK reads and resends the rest of the record.
2
+ * Changes only a resident's email and phone in one request without reading or resending other fields.
3
3
  * Resolves `{ status: 'conflict', conflict: 'EMAIL_IN_USE' | 'PHONE_IN_USE' }` when another person
4
4
  * uses the email or phone.
5
5
  */
@@ -3,7 +3,7 @@ import { updateResidentContactMutationOptions } from '@solibo/solibo-query';
3
3
  import { useMutation } from '../../../utils/useMutation.js';
4
4
  import { useSdk } from '../../../sdkProvider.js';
5
5
  /**
6
- * Changes only a resident's email and phone; the SDK reads and resends the rest of the record.
6
+ * Changes only a resident's email and phone in one request without reading or resending other fields.
7
7
  * Resolves `{ status: 'conflict', conflict: 'EMAIL_IN_USE' | 'PHONE_IN_USE' }` when another person
8
8
  * uses the email or phone.
9
9
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solibo/solibo-react",
3
- "version": "1.58.0",
3
+ "version": "1.58.1-feature-atomic-draft-save-17257f6-1795685259768-SNAPSHOT",
4
4
  "description": "React hooks for the Solibo Home SDK, built on @solibo/solibo-query. Solibo Home is the platform for owning and managing homes in Norway.",
5
5
  "homepage": "https://sdk.solibo.no",
6
6
  "repository": {
@@ -68,8 +68,8 @@
68
68
  "yjs": "^13.6.0"
69
69
  },
70
70
  "dependencies": {
71
- "@solibo/solibo-query": "1.58.0",
72
- "@solibo/solibo-sdk": "1.58.0"
71
+ "@solibo/solibo-query": "1.58.1-feature-atomic-draft-save-17257f6-1795685259768-SNAPSHOT",
72
+ "@solibo/solibo-sdk": "1.58.1-feature-atomic-draft-save-17257f6-1795685259768-SNAPSHOT"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@eslint/js": "^10.0.1",