@openpeepshq/common 0.15.0 → 0.16.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.
|
@@ -17,3 +17,31 @@ export declare const EVENT_HEADER_ASPECT_RATIO = "16:9";
|
|
|
17
17
|
* with grey gaps.
|
|
18
18
|
*/
|
|
19
19
|
export declare const PROFILE_GROUP_HEADER_ASPECT_RATIO = "3:1";
|
|
20
|
+
/**
|
|
21
|
+
* Max duration (seconds) of voice notes recorded in the post composers.
|
|
22
|
+
* Enforced on the client (web modal + RN sheet) and re-checked server-side
|
|
23
|
+
* during media processing, so it is the single source of truth for the cap.
|
|
24
|
+
*
|
|
25
|
+
* Boundary rule — clients auto-stop at `VOICE_NOTE_AUTO_STOP_SECONDS`, the
|
|
26
|
+
* server rejects with `>`: the recorders tick every 500 ms and the stop check
|
|
27
|
+
* runs against the *raw* wall-clock span, so a take can finish anywhere in
|
|
28
|
+
* [90.0 s, 90.5 s). The file's probed duration is that raw span, so stopping
|
|
29
|
+
* at exactly 90 s would let roughly half of honest cap-length takes probe
|
|
30
|
+
* above the server's `duration > 90` check and surface the 400 right after
|
|
31
|
+
* the recorder stopped itself. Auto-stopping at 89.5 s keeps every honest
|
|
32
|
+
* take strictly under 90 s (≤ 89.999 s), while a genuinely-overshot or
|
|
33
|
+
* crafted upload (≥ 90.5 s) still probes above the cap and is rejected —
|
|
34
|
+
* the two sides are pinned by tests (`transcodeAudio.test.ts`,
|
|
35
|
+
* `mediaDimensions.test.ts`, `VoiceRecorderModal.test.tsx`,
|
|
36
|
+
* `record-audio-sheet.test.tsx`) so they cannot drift apart — change either
|
|
37
|
+
* the threshold or the server operator only together with those tests.
|
|
38
|
+
*/
|
|
39
|
+
export declare const VOICE_NOTE_MAX_SECONDS = 90;
|
|
40
|
+
/**
|
|
41
|
+
* The wall-clock moment the recorders auto-stop. Half a second *under*
|
|
42
|
+
* VOICE_NOTE_MAX_SECONDS: the coarse 500 ms tick that detects the threshold
|
|
43
|
+
* guarantees the actual file stays under the cap (see above), which is what
|
|
44
|
+
* makes the server's `duration > VOICE_NOTE_MAX_SECONDS` boundary safe for
|
|
45
|
+
* honest takes.
|
|
46
|
+
*/
|
|
47
|
+
export declare const VOICE_NOTE_AUTO_STOP_SECONDS: number;
|
|
@@ -17,3 +17,31 @@ export const EVENT_HEADER_ASPECT_RATIO = '16:9';
|
|
|
17
17
|
* with grey gaps.
|
|
18
18
|
*/
|
|
19
19
|
export const PROFILE_GROUP_HEADER_ASPECT_RATIO = '3:1';
|
|
20
|
+
/**
|
|
21
|
+
* Max duration (seconds) of voice notes recorded in the post composers.
|
|
22
|
+
* Enforced on the client (web modal + RN sheet) and re-checked server-side
|
|
23
|
+
* during media processing, so it is the single source of truth for the cap.
|
|
24
|
+
*
|
|
25
|
+
* Boundary rule — clients auto-stop at `VOICE_NOTE_AUTO_STOP_SECONDS`, the
|
|
26
|
+
* server rejects with `>`: the recorders tick every 500 ms and the stop check
|
|
27
|
+
* runs against the *raw* wall-clock span, so a take can finish anywhere in
|
|
28
|
+
* [90.0 s, 90.5 s). The file's probed duration is that raw span, so stopping
|
|
29
|
+
* at exactly 90 s would let roughly half of honest cap-length takes probe
|
|
30
|
+
* above the server's `duration > 90` check and surface the 400 right after
|
|
31
|
+
* the recorder stopped itself. Auto-stopping at 89.5 s keeps every honest
|
|
32
|
+
* take strictly under 90 s (≤ 89.999 s), while a genuinely-overshot or
|
|
33
|
+
* crafted upload (≥ 90.5 s) still probes above the cap and is rejected —
|
|
34
|
+
* the two sides are pinned by tests (`transcodeAudio.test.ts`,
|
|
35
|
+
* `mediaDimensions.test.ts`, `VoiceRecorderModal.test.tsx`,
|
|
36
|
+
* `record-audio-sheet.test.tsx`) so they cannot drift apart — change either
|
|
37
|
+
* the threshold or the server operator only together with those tests.
|
|
38
|
+
*/
|
|
39
|
+
export const VOICE_NOTE_MAX_SECONDS = 90;
|
|
40
|
+
/**
|
|
41
|
+
* The wall-clock moment the recorders auto-stop. Half a second *under*
|
|
42
|
+
* VOICE_NOTE_MAX_SECONDS: the coarse 500 ms tick that detects the threshold
|
|
43
|
+
* guarantees the actual file stays under the cap (see above), which is what
|
|
44
|
+
* makes the server's `duration > VOICE_NOTE_MAX_SECONDS` boundary safe for
|
|
45
|
+
* honest takes.
|
|
46
|
+
*/
|
|
47
|
+
export const VOICE_NOTE_AUTO_STOP_SECONDS = VOICE_NOTE_MAX_SECONDS - 0.5;
|
package/package.json
CHANGED
|
@@ -19,3 +19,33 @@ export const EVENT_HEADER_ASPECT_RATIO = '16:9';
|
|
|
19
19
|
* with grey gaps.
|
|
20
20
|
*/
|
|
21
21
|
export const PROFILE_GROUP_HEADER_ASPECT_RATIO = '3:1';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Max duration (seconds) of voice notes recorded in the post composers.
|
|
25
|
+
* Enforced on the client (web modal + RN sheet) and re-checked server-side
|
|
26
|
+
* during media processing, so it is the single source of truth for the cap.
|
|
27
|
+
*
|
|
28
|
+
* Boundary rule — clients auto-stop at `VOICE_NOTE_AUTO_STOP_SECONDS`, the
|
|
29
|
+
* server rejects with `>`: the recorders tick every 500 ms and the stop check
|
|
30
|
+
* runs against the *raw* wall-clock span, so a take can finish anywhere in
|
|
31
|
+
* [90.0 s, 90.5 s). The file's probed duration is that raw span, so stopping
|
|
32
|
+
* at exactly 90 s would let roughly half of honest cap-length takes probe
|
|
33
|
+
* above the server's `duration > 90` check and surface the 400 right after
|
|
34
|
+
* the recorder stopped itself. Auto-stopping at 89.5 s keeps every honest
|
|
35
|
+
* take strictly under 90 s (≤ 89.999 s), while a genuinely-overshot or
|
|
36
|
+
* crafted upload (≥ 90.5 s) still probes above the cap and is rejected —
|
|
37
|
+
* the two sides are pinned by tests (`transcodeAudio.test.ts`,
|
|
38
|
+
* `mediaDimensions.test.ts`, `VoiceRecorderModal.test.tsx`,
|
|
39
|
+
* `record-audio-sheet.test.tsx`) so they cannot drift apart — change either
|
|
40
|
+
* the threshold or the server operator only together with those tests.
|
|
41
|
+
*/
|
|
42
|
+
export const VOICE_NOTE_MAX_SECONDS = 90;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The wall-clock moment the recorders auto-stop. Half a second *under*
|
|
46
|
+
* VOICE_NOTE_MAX_SECONDS: the coarse 500 ms tick that detects the threshold
|
|
47
|
+
* guarantees the actual file stays under the cap (see above), which is what
|
|
48
|
+
* makes the server's `duration > VOICE_NOTE_MAX_SECONDS` boundary safe for
|
|
49
|
+
* honest takes.
|
|
50
|
+
*/
|
|
51
|
+
export const VOICE_NOTE_AUTO_STOP_SECONDS = VOICE_NOTE_MAX_SECONDS - 0.5;
|