Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b6a2def2d | ||
|
|
47952f78e5 | ||
|
|
31b0f8a4bf | ||
|
|
4ebbf0d691 | ||
|
|
163a0e5e88 | ||
|
|
0be7d77a49 | ||
|
|
e6ad9d0991 | ||
|
|
c908342167 | ||
|
|
1f094bf922 | ||
|
|
bed1b70504 | ||
|
|
7bc8c17c0a | ||
|
|
99833a0b8c | ||
|
|
18e79b36fd |
No files matched your search
@@ -1,4 +1,15 @@
|
||||
# Changelog
|
||||
## [2.1.27] - 2026-10-10
|
||||
### Added
|
||||
- End a held breath from the minimized practice window with Breath or a double tap.
|
||||
- Lumi feedback includes the app version, device and system.
|
||||
### Fixed
|
||||
- Picture-in-picture opens when you leave Inbe during a practice and returns to it.
|
||||
- Lumi keeps answers that arrive during picture-in-picture.
|
||||
- Lumi says whether feedback reached the developer and keeps it to retry.
|
||||
- Feedback saved by older versions is now sent.
|
||||
- Fix a startup crash on 32-bit Android phones.
|
||||
|
||||
## [2.1.26] - 2026-10-09
|
||||
### Added
|
||||
- Detach a running practice into its own resizable desktop window.
|
||||
|
||||
@@ -3176,3 +3176,19 @@ android-geometry-probe-test:
|
||||
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS sh tests/android_geometry_probe_test.sh
|
||||
|
||||
test: android-geometry-probe-test
|
||||
|
||||
.PHONY: lumi-feedback-delivery-test
|
||||
lumi-feedback-delivery-test: $(ZIRAN_BIN) $(LIBOQS_A) | build-laws
|
||||
@sh tests/lumi_feedback_delivery_test.sh $(ZIRAN_BIN) $(LIBOQS_A)
|
||||
|
||||
test: lumi-feedback-delivery-test
|
||||
|
||||
# Lumi reports name the device, system and version (no identifiers).
|
||||
.PHONY: device-info-test
|
||||
device-info-test: $(ZIRAN_BIN)
|
||||
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY $(ZIRAN_BIN) build --target=c --define PLATFORM_DESKTOP --root tests \
|
||||
--module-path src --module-path build/packages/ziran/std --entry device_info_behavior:Main --exe \
|
||||
-o build/device-info-test tests/device_info_behavior.zi
|
||||
@build/device-info-test/device_info_behavior
|
||||
|
||||
test: device-info-test
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## [2.1.22] - 2026-10-10
|
||||
|
||||
- Say which app, device and system details Lumi feedback includes before you send it.
|
||||
|
||||
## [2.1.21] - 2026-10-10
|
||||
|
||||
- Explain when approved Lumi feedback is still waiting to send and when the developer inbox has received it.
|
||||
|
||||
## [2.1.20] - 2026-10-09
|
||||
|
||||
- Customize each app in Appearance using live KSS editing, inspection, undo, and reset to defaults.
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@
|
||||
"apps": {
|
||||
"inbe": {
|
||||
"id": "inbe",
|
||||
"version": "2.1.20",
|
||||
"sequence": 17,
|
||||
"version": "2.1.22",
|
||||
"sequence": 19,
|
||||
"bundled": true
|
||||
},
|
||||
"habits": {
|
||||
|
||||
@@ -70,6 +70,13 @@ app effects; no database pointers or arbitrary code cross the cell boundary.
|
||||
Lumi can open Settings or Appearance, change the app theme with `/theme forest`
|
||||
(or another published theme name), and choose light, dark or system mode.
|
||||
These actions use the same validation, persistence and refresh path as Settings.
|
||||
Bug reports and suggestions still require the feedback card's Yes. The first
|
||||
acknowledgement means the report is queued on this device; delivery requires an
|
||||
Inner Breeze account and internet access. Lumi confirms receipt by the private
|
||||
developer inbox only after Daochi returns the matching report ID. A failed or
|
||||
invalid acknowledgement leaves the approved report queued for retry and adds a
|
||||
failure notice once, including across restarts. Inbox receipt does not mean a
|
||||
developer has reviewed the report or started a fix.
|
||||
Lumi can display typed chart and donation cards alongside text replies. Ask
|
||||
`/progress sessions 7`, `/progress meditation 30`, `/progress retention 7`, or
|
||||
`/progress habits 7` (1–31 days including today). Charts use the active account's
|
||||
|
||||
@@ -56,8 +56,8 @@ android {
|
||||
minSdk 21
|
||||
targetSdk 36
|
||||
testInstrumentationRunner "android.test.InstrumentationTestRunner"
|
||||
versionCode 163
|
||||
versionName "2.1.26"
|
||||
versionCode 164
|
||||
versionName "2.1.27"
|
||||
manifestPlaceholders = [
|
||||
inbeAppLabel: "Inner Breeze",
|
||||
inbeUsesCleartextTraffic: "false"
|
||||
|
||||
@@ -25,6 +25,7 @@ set(SQLITE_BUILD_DIR "${CMAKE_BINARY_DIR}/sqlite")
|
||||
set(SQLITE_AMALGAMATION_C "${SQLITE_BUILD_DIR}/sqlite3.c")
|
||||
set(SQLITE_AMALGAMATION_H "${SQLITE_BUILD_DIR}/sqlite3.h")
|
||||
include("${KRYON_DIR}/cmake/KryonAndroid.cmake")
|
||||
kryon_android_reproducible_paths("${REPO_ROOT}")
|
||||
set(OQS_BUILD_ONLY_LIB ON CACHE BOOL "" FORCE)
|
||||
set(OQS_USE_OPENSSL OFF CACHE BOOL "" FORCE)
|
||||
set(OQS_MINIMAL_BUILD "SIG_ml_dsa_44;KEM_ml_kem_768" CACHE STRING "" FORCE)
|
||||
|
||||
@@ -32,6 +32,7 @@ final class HttpTransport {
|
||||
final URL url;
|
||||
final int capacity;
|
||||
final int timeout;
|
||||
final long deadline;
|
||||
final Map<String, String> headers = new LinkedHashMap<>();
|
||||
volatile HttpURLConnection connection;
|
||||
volatile Future<?> worker;
|
||||
@@ -46,6 +47,7 @@ final class HttpTransport {
|
||||
this.url = url;
|
||||
this.capacity = capacity;
|
||||
this.timeout = timeout;
|
||||
this.deadline = System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(timeout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,10 +61,15 @@ final class HttpTransport {
|
||||
synchronized int create(byte[] methodBytes, byte[] urlBytes, int capacity, int timeout) {
|
||||
if (closed || methodBytes == null || urlBytes == null || methodBytes.length < 1 ||
|
||||
methodBytes.length > 31 || urlBytes.length < 1 || urlBytes.length >= 2048 ||
|
||||
capacity < 1 || capacity > LIMIT || timeout < 1 || timeout > 900000 ||
|
||||
transfers.size() >= 8) {
|
||||
capacity < 1 || capacity > LIMIT || timeout < 1 || timeout > 900000) {
|
||||
return 0;
|
||||
}
|
||||
if (transfers.size() >= 8) {
|
||||
reclaimUncollected();
|
||||
if (transfers.size() >= 8) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
try {
|
||||
String method = text(methodBytes);
|
||||
URL url = new URL(text(urlBytes));
|
||||
@@ -127,12 +134,13 @@ final class HttpTransport {
|
||||
}
|
||||
|
||||
private void expire(int id, Transfer transfer) {
|
||||
// Also reclaim completed responses whose native caller lost its JNI
|
||||
// attachment or stopped polling. A handle never outlives its deadline.
|
||||
if (!transfers.remove(id, transfer)) {
|
||||
return;
|
||||
}
|
||||
// The deadline bounds the exchange, not its collection. A completed
|
||||
// response waits for the caller, which does not poll while paused,
|
||||
// in picture-in-picture or during a practice.
|
||||
synchronized (transfer) {
|
||||
if (transfer.state >= 0 || !transfers.remove(id, transfer)) {
|
||||
return;
|
||||
}
|
||||
transfer.cancelled = true;
|
||||
transfer.state = 0;
|
||||
transfer.response = null;
|
||||
@@ -140,6 +148,23 @@ final class HttpTransport {
|
||||
stop(transfer);
|
||||
}
|
||||
|
||||
// Free the slots of completed responses left uncollected past their
|
||||
// deadline, so a caller that lost its JNI handle cannot exhaust them.
|
||||
private void reclaimUncollected() {
|
||||
long now = System.nanoTime();
|
||||
for (Map.Entry<Integer, Transfer> entry : transfers.entrySet()) {
|
||||
Transfer transfer = entry.getValue();
|
||||
synchronized (transfer) {
|
||||
if (transfer.state < 0 || now - transfer.deadline < 0 ||
|
||||
!transfers.remove(entry.getKey(), transfer)) {
|
||||
continue;
|
||||
}
|
||||
transfer.cancelled = true;
|
||||
transfer.response = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void stop(Transfer transfer) {
|
||||
Future<?> worker = transfer.worker;
|
||||
if (worker != null) {
|
||||
@@ -164,7 +189,7 @@ final class HttpTransport {
|
||||
connection.setInstanceFollowRedirects(false);
|
||||
connection.setUseCaches(false);
|
||||
connection.setConnectTimeout(Math.min(15000, transfer.timeout));
|
||||
connection.setReadTimeout(Math.min(30000, transfer.timeout));
|
||||
connection.setReadTimeout(transfer.timeout);
|
||||
connection.setRequestMethod(transfer.method);
|
||||
// System HTTPS trust and hostname verification are left intact.
|
||||
for (Map.Entry<String, String> header : transfer.headers.entrySet()) {
|
||||
|
||||
@@ -64,6 +64,10 @@ public class MainActivity extends NativeActivity {
|
||||
private boolean pictureWindowEntering;
|
||||
private boolean activityStopped;
|
||||
private int pictureWindowGeneration;
|
||||
// Flips each time the floating window opens back into the app, so native
|
||||
// shows the practice instead of the page behind its in-app window. It is
|
||||
// static because native state also outlives a recreated activity.
|
||||
private static int pictureWindowReturns;
|
||||
|
||||
// Called by the native frame thread. A volatile snapshot avoids changing
|
||||
// practice state from Android's UI callbacks.
|
||||
@@ -87,8 +91,9 @@ public class MainActivity extends NativeActivity {
|
||||
}
|
||||
|
||||
private void refreshPictureWindowState() {
|
||||
pictureWindowGeneration = (pictureWindowGeneration + 1) & 0x1fffffff;
|
||||
pictureWindowState = (pictureWindowGeneration << 2) | (supportsPictureWindow() ? 1 : 0)
|
||||
pictureWindowGeneration = (pictureWindowGeneration + 1) & 0x0fffffff;
|
||||
pictureWindowState = (pictureWindowGeneration << 3) | ((pictureWindowReturns & 1) << 2)
|
||||
| (supportsPictureWindow() ? 1 : 0)
|
||||
| (Build.VERSION.SDK_INT >= 26 && isInPictureInPictureMode()
|
||||
&& !activityStopped ? 2 : 0);
|
||||
}
|
||||
@@ -147,7 +152,10 @@ public class MainActivity extends NativeActivity {
|
||||
@Override
|
||||
protected void onUserLeaveHint() {
|
||||
super.onUserLeaveHint();
|
||||
if (Build.VERSION.SDK_INT >= 26 && Build.VERSION.SDK_INT < 31) {
|
||||
// Android 12 enters on its own only when the next activity resumes
|
||||
// while this one pauses, as the stock launcher does. Leaving for a
|
||||
// third-party launcher or another app comes here instead.
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
enterPictureWindow(false);
|
||||
}
|
||||
}
|
||||
@@ -156,6 +164,11 @@ public class MainActivity extends NativeActivity {
|
||||
public void onPictureInPictureModeChanged(boolean visible, Configuration configuration) {
|
||||
super.onPictureInPictureModeChanged(visible, configuration);
|
||||
pictureWindowEntering = false;
|
||||
// Closing the floating window stops the activity first; opening it
|
||||
// back into the app leaves the activity started.
|
||||
if (!visible && !activityStopped) {
|
||||
pictureWindowReturns++;
|
||||
}
|
||||
refreshPictureWindowState();
|
||||
requestInsetRefresh();
|
||||
syncLifecycleState("onPictureInPictureModeChanged");
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Added
|
||||
---
|
||||
- End a held breath from the minimized practice window with Breath or a double tap.
|
||||
- Lumi feedback includes the app version, device and system.
|
||||
Fixed
|
||||
---
|
||||
- Picture-in-picture opens when you leave Inbe during a practice and returns to it.
|
||||
- Lumi keeps answers that arrive during picture-in-picture.
|
||||
- Lumi says whether feedback reached the developer and keeps it to retry.
|
||||
- Feedback saved by older versions is now sent.
|
||||
- Fix a startup crash on 32-bit Android phones.
|
||||
+10
-2
@@ -2324,7 +2324,7 @@ Odpověď vývojáře:
|
||||
|
||||
---
|
||||
[lumi_feedback_saved]
|
||||
Zpětná vazba byla uložena pro vývojáře.
|
||||
Uloženo v tomto zařízení a čeká na odeslání do schránky vývojáře. Je potřeba účet Inner Breeze a přístup k internetu.
|
||||
|
||||
---
|
||||
[lumi_show_progress]
|
||||
@@ -2358,7 +2358,7 @@ V tomto období není zaznamenána žádná aktivita.
|
||||
|
||||
---
|
||||
[lumi_feedback_confirm]
|
||||
Odeslat tuto zpětnou vazbu vývojáři?
|
||||
Odeslat tuto zpětnou vazbu vývojáři? Přiloží se verze aplikace, model zařízení a verze systému.
|
||||
|
||||
---
|
||||
[lumi_feedback_yes]
|
||||
@@ -2662,3 +2662,11 @@ Oddělit okno cvičení
|
||||
[session_attach_button]
|
||||
Vrátit okno do aplikace
|
||||
---
|
||||
|
||||
[lumi_feedback_delivered]
|
||||
Schránka vývojáře přijala vaši zpětnou vazbu.
|
||||
---
|
||||
|
||||
[lumi_feedback_unavailable]
|
||||
Doručení do schránky vývojáře není potvrzeno. Vaše zpětná vazba zůstává uložená v tomto zařízení a odeslání se zkusí znovu.
|
||||
---
|
||||
+10
-2
@@ -2324,7 +2324,7 @@ Antwort vom Entwickler:
|
||||
|
||||
---
|
||||
[lumi_feedback_saved]
|
||||
Dein Feedback wurde für den Entwickler gespeichert.
|
||||
Auf diesem Gerät gespeichert und wartet auf den Versand an den Entwicklereingang. Dafür sind ein Inner Breeze-Konto und Internetzugang erforderlich.
|
||||
|
||||
---
|
||||
[lumi_show_progress]
|
||||
@@ -2358,7 +2358,7 @@ Keine aufgezeichnete Aktivität in diesem Zeitraum.
|
||||
|
||||
---
|
||||
[lumi_feedback_confirm]
|
||||
Dieses Feedback an den Entwickler senden?
|
||||
Dieses Feedback an den Entwickler senden? App-Version, Gerätemodell und Systemversion werden mitgesendet.
|
||||
|
||||
---
|
||||
[lumi_feedback_yes]
|
||||
@@ -2662,3 +2662,11 @@ Warte auf das Gerät mit der laufenden Sitzung
|
||||
[session_attach_button]
|
||||
Fenster in die App zurückholen
|
||||
---
|
||||
|
||||
[lumi_feedback_delivered]
|
||||
Dein Feedback ist im Entwicklereingang angekommen.
|
||||
---
|
||||
|
||||
[lumi_feedback_unavailable]
|
||||
Die Zustellung an den Entwicklereingang ist nicht bestätigt. Dein Feedback bleibt auf diesem Gerät gespeichert und der Versand wird erneut versucht.
|
||||
---
|
||||
+10
-2
@@ -2323,7 +2323,7 @@ Developer reply:
|
||||
|
||||
---
|
||||
[lumi_feedback_saved]
|
||||
Saved your feedback for the developer.
|
||||
Saved on this device, waiting to send to the developer inbox. Delivery needs an Inner Breeze account and internet access.
|
||||
|
||||
---
|
||||
[lumi_show_progress]
|
||||
@@ -2357,7 +2357,7 @@ No recorded activity in this period.
|
||||
|
||||
---
|
||||
[lumi_feedback_confirm]
|
||||
Send this feedback to the developer?
|
||||
Send this feedback to the developer? It includes your app version, device model and system version.
|
||||
|
||||
---
|
||||
[lumi_feedback_yes]
|
||||
@@ -2661,3 +2661,11 @@ Detach practice window
|
||||
[session_attach_button]
|
||||
Return window to app
|
||||
---
|
||||
|
||||
[lumi_feedback_delivered]
|
||||
The developer inbox received your feedback.
|
||||
---
|
||||
|
||||
[lumi_feedback_unavailable]
|
||||
Delivery to the developer inbox is not confirmed. Your feedback is saved on this device and will retry.
|
||||
---
|
||||
+10
-2
@@ -2324,7 +2324,7 @@ Respuesta del desarrollador:
|
||||
|
||||
---
|
||||
[lumi_feedback_saved]
|
||||
Guardé tus comentarios para el desarrollador.
|
||||
Guardado en este dispositivo, pendiente de envío al buzón del desarrollador. Se necesita una cuenta de Inner Breeze y acceso a internet.
|
||||
|
||||
---
|
||||
[lumi_show_progress]
|
||||
@@ -2358,7 +2358,7 @@ No hay actividad registrada en este período.
|
||||
|
||||
---
|
||||
[lumi_feedback_confirm]
|
||||
¿Enviar estos comentarios al desarrollador?
|
||||
¿Enviar estos comentarios al desarrollador? Incluyen la versión de la app, el modelo del dispositivo y la versión del sistema.
|
||||
|
||||
---
|
||||
[lumi_feedback_yes]
|
||||
@@ -2662,3 +2662,11 @@ Separar la ventana de práctica
|
||||
[session_attach_button]
|
||||
Devolver la ventana a la aplicación
|
||||
---
|
||||
|
||||
[lumi_feedback_delivered]
|
||||
El buzón del desarrollador recibió tus comentarios.
|
||||
---
|
||||
|
||||
[lumi_feedback_unavailable]
|
||||
No se ha confirmado la entrega al buzón del desarrollador. Tus comentarios están guardados en este dispositivo y se volverá a intentar el envío.
|
||||
---
|
||||
+10
-2
@@ -2324,7 +2324,7 @@ Réponse du développeur :
|
||||
|
||||
---
|
||||
[lumi_feedback_saved]
|
||||
Tes commentaires ont été enregistrés pour le développeur.
|
||||
Enregistré sur cet appareil, en attente d’envoi à la boîte du développeur. Un compte Inner Breeze et un accès à internet sont nécessaires.
|
||||
|
||||
---
|
||||
[lumi_show_progress]
|
||||
@@ -2358,7 +2358,7 @@ Aucune activité enregistrée sur cette période.
|
||||
|
||||
---
|
||||
[lumi_feedback_confirm]
|
||||
Envoyer ces commentaires au développeur ?
|
||||
Envoyer ces commentaires au développeur ? Ils incluent la version de l’app, le modèle de l’appareil et la version du système.
|
||||
|
||||
---
|
||||
[lumi_feedback_yes]
|
||||
@@ -2662,3 +2662,11 @@ Détacher la fenêtre de pratique
|
||||
[session_attach_button]
|
||||
Ramener la fenêtre dans l’application
|
||||
---
|
||||
|
||||
[lumi_feedback_delivered]
|
||||
La boîte du développeur a reçu votre retour.
|
||||
---
|
||||
|
||||
[lumi_feedback_unavailable]
|
||||
La livraison à la boîte du développeur n’est pas confirmée. Votre retour reste enregistré sur cet appareil et l’envoi sera réessayé.
|
||||
---
|
||||
+10
-2
@@ -2324,7 +2324,7 @@ Balasan pengembang:
|
||||
|
||||
---
|
||||
[lumi_feedback_saved]
|
||||
Masukanmu telah disimpan untuk pengembang.
|
||||
Tersimpan di perangkat ini dan menunggu dikirim ke kotak masuk pengembang. Pengiriman memerlukan akun Inner Breeze dan akses internet.
|
||||
|
||||
---
|
||||
[lumi_show_progress]
|
||||
@@ -2358,7 +2358,7 @@ Tidak ada aktivitas tercatat dalam periode ini.
|
||||
|
||||
---
|
||||
[lumi_feedback_confirm]
|
||||
Kirim masukan ini kepada pengembang?
|
||||
Kirim masukan ini kepada pengembang? Termasuk versi aplikasi, model perangkat, dan versi sistem.
|
||||
|
||||
---
|
||||
[lumi_feedback_yes]
|
||||
@@ -2662,3 +2662,11 @@ Pisahkan jendela latihan
|
||||
[session_attach_button]
|
||||
Kembalikan jendela ke aplikasi
|
||||
---
|
||||
|
||||
[lumi_feedback_delivered]
|
||||
Kotak masuk pengembang telah menerima masukanmu.
|
||||
---
|
||||
|
||||
[lumi_feedback_unavailable]
|
||||
Pengiriman ke kotak masuk pengembang belum terkonfirmasi. Masukanmu tersimpan di perangkat ini dan pengiriman akan dicoba lagi.
|
||||
---
|
||||
+10
-2
@@ -2324,7 +2324,7 @@ Risposta dello sviluppatore:
|
||||
|
||||
---
|
||||
[lumi_feedback_saved]
|
||||
Ho salvato il tuo feedback per lo sviluppatore.
|
||||
Salvato su questo dispositivo, in attesa di invio alla casella dello sviluppatore. Servono un account Inner Breeze e una connessione internet.
|
||||
|
||||
---
|
||||
[lumi_show_progress]
|
||||
@@ -2358,7 +2358,7 @@ Nessuna attività registrata in questo periodo.
|
||||
|
||||
---
|
||||
[lumi_feedback_confirm]
|
||||
Inviare questo feedback allo sviluppatore?
|
||||
Inviare questo feedback allo sviluppatore? Include la versione dell’app, il modello del dispositivo e la versione del sistema.
|
||||
|
||||
---
|
||||
[lumi_feedback_yes]
|
||||
@@ -2662,3 +2662,11 @@ Stacca la finestra della pratica
|
||||
[session_attach_button]
|
||||
Riporta la finestra nell’app
|
||||
---
|
||||
|
||||
[lumi_feedback_delivered]
|
||||
La casella dello sviluppatore ha ricevuto il tuo feedback.
|
||||
---
|
||||
|
||||
[lumi_feedback_unavailable]
|
||||
La consegna alla casella dello sviluppatore non è confermata. Il tuo feedback resta salvato su questo dispositivo e l’invio verrà ritentato.
|
||||
---
|
||||
+10
-2
@@ -2326,7 +2326,7 @@ WHMを開始
|
||||
|
||||
---
|
||||
[lumi_feedback_saved]
|
||||
開発者へのフィードバックを保存しました。
|
||||
この端末に保存され、開発者の受信箱への送信を待っています。送信には Inner Breeze アカウントとインターネット接続が必要です。
|
||||
|
||||
---
|
||||
[lumi_show_progress]
|
||||
@@ -2360,7 +2360,7 @@ WHMの最長息止め時間(秒)
|
||||
|
||||
---
|
||||
[lumi_feedback_confirm]
|
||||
このフィードバックを開発者に送信しますか?
|
||||
このフィードバックを開発者に送信しますか?アプリのバージョン、端末のモデル、システムのバージョンが含まれます。
|
||||
|
||||
---
|
||||
[lumi_feedback_yes]
|
||||
@@ -2664,3 +2664,11 @@ Lumiに相談
|
||||
[session_attach_button]
|
||||
ウィンドウをアプリに戻す
|
||||
---
|
||||
|
||||
[lumi_feedback_delivered]
|
||||
開発者の受信箱でフィードバックを受信しました。
|
||||
---
|
||||
|
||||
[lumi_feedback_unavailable]
|
||||
開発者の受信箱への配信は確認できていません。フィードバックはこの端末に保存され、送信を再試行します。
|
||||
---
|
||||
+10
-2
@@ -2324,7 +2324,7 @@ WHM 시작
|
||||
|
||||
---
|
||||
[lumi_feedback_saved]
|
||||
개발자에게 보낼 의견을 저장했어요.
|
||||
이 기기에 저장되었으며 개발자 수신함으로 전송을 기다리고 있어요. 전송하려면 Inner Breeze 계정과 인터넷 연결이 필요해요.
|
||||
|
||||
---
|
||||
[lumi_show_progress]
|
||||
@@ -2358,7 +2358,7 @@ WHM 시작
|
||||
|
||||
---
|
||||
[lumi_feedback_confirm]
|
||||
이 피드백을 개발자에게 보낼까요?
|
||||
이 피드백을 개발자에게 보낼까요? 앱 버전, 기기 이름, 시스템 버전이 함께 전송됩니다.
|
||||
|
||||
---
|
||||
[lumi_feedback_yes]
|
||||
@@ -2662,3 +2662,11 @@ Lumi에게 요청
|
||||
[session_attach_button]
|
||||
창을 앱으로 되돌리기
|
||||
---
|
||||
|
||||
[lumi_feedback_delivered]
|
||||
개발자 수신함에서 피드백을 받았어요.
|
||||
---
|
||||
|
||||
[lumi_feedback_unavailable]
|
||||
개발자 수신함으로 전달되었는지 확인되지 않았어요. 피드백은 이 기기에 저장되어 있으며 전송을 다시 시도할 거예요.
|
||||
---
|
||||
+10
-2
@@ -2324,7 +2324,7 @@ Resposta do desenvolvedor:
|
||||
|
||||
---
|
||||
[lumi_feedback_saved]
|
||||
Salvei seu feedback para o desenvolvedor.
|
||||
Guardado neste dispositivo, à espera de envio para a caixa de entrada do programador. É necessária uma conta Inner Breeze e acesso à internet.
|
||||
|
||||
---
|
||||
[lumi_show_progress]
|
||||
@@ -2358,7 +2358,7 @@ Nenhuma atividade registrada neste período.
|
||||
|
||||
---
|
||||
[lumi_feedback_confirm]
|
||||
Enviar este feedback ao desenvolvedor?
|
||||
Enviar este feedback ao desenvolvedor? Ele inclui a versão do app, o modelo do dispositivo e a versão do sistema.
|
||||
|
||||
---
|
||||
[lumi_feedback_yes]
|
||||
@@ -2662,3 +2662,11 @@ Separar a janela da prática
|
||||
[session_attach_button]
|
||||
Devolver a janela ao aplicativo
|
||||
---
|
||||
|
||||
[lumi_feedback_delivered]
|
||||
A caixa de entrada do programador recebeu o teu comentário.
|
||||
---
|
||||
|
||||
[lumi_feedback_unavailable]
|
||||
A entrega na caixa de entrada do programador não está confirmada. O teu comentário continua guardado neste dispositivo e o envio será tentado novamente.
|
||||
---
|
||||
+10
-2
@@ -2324,7 +2324,7 @@ Inner Breeze бесплатное приложение с открытым ис
|
||||
|
||||
---
|
||||
[lumi_feedback_saved]
|
||||
Ваш отзыв сохранён для разработчика.
|
||||
Сохранено на этом устройстве и ожидает отправки в почтовый ящик разработчика. Для доставки нужны аккаунт Inner Breeze и доступ к интернету.
|
||||
|
||||
---
|
||||
[lumi_show_progress]
|
||||
@@ -2358,7 +2358,7 @@ Inner Breeze бесплатное приложение с открытым ис
|
||||
|
||||
---
|
||||
[lumi_feedback_confirm]
|
||||
Отправить этот отзыв разработчику?
|
||||
Отправить этот отзыв разработчику? К нему прилагаются версия приложения, модель устройства и версия системы.
|
||||
|
||||
---
|
||||
[lumi_feedback_yes]
|
||||
@@ -2662,3 +2662,11 @@ Inner Breeze бесплатное приложение с открытым ис
|
||||
[session_attach_button]
|
||||
Вернуть окно в приложение
|
||||
---
|
||||
|
||||
[lumi_feedback_delivered]
|
||||
Ваш отзыв получен в почтовом ящике разработчика.
|
||||
---
|
||||
|
||||
[lumi_feedback_unavailable]
|
||||
Доставка в почтовый ящик разработчика не подтверждена. Ваш отзыв сохранён на этом устройстве, и отправка будет повторена.
|
||||
---
|
||||
+10
-2
@@ -2324,7 +2324,7 @@ Inner Breeze 免费且开源。如果它对您有帮助,一点小额捐赠将
|
||||
|
||||
---
|
||||
[lumi_feedback_saved]
|
||||
已保存你的反馈,供开发者查看。
|
||||
已保存在此设备上,等待发送到开发者收件箱。发送需要 Inner Breeze 账户和互联网连接。
|
||||
|
||||
---
|
||||
[lumi_show_progress]
|
||||
@@ -2358,7 +2358,7 @@ WHM 最长屏息时间(秒)
|
||||
|
||||
---
|
||||
[lumi_feedback_confirm]
|
||||
将此反馈发送给开发者吗?
|
||||
将此反馈发送给开发者吗?应用版本、设备名称和系统版本会一起发送。
|
||||
|
||||
---
|
||||
[lumi_feedback_yes]
|
||||
@@ -2662,3 +2662,11 @@ Daochi 节点
|
||||
[session_attach_button]
|
||||
将窗口移回应用
|
||||
---
|
||||
|
||||
[lumi_feedback_delivered]
|
||||
开发者收件箱已收到你的反馈。
|
||||
---
|
||||
|
||||
[lumi_feedback_unavailable]
|
||||
尚未确认反馈已送达开发者收件箱。反馈已保存在此设备上,稍后会重试发送。
|
||||
---
|
||||
@@ -1,5 +1,5 @@
|
||||
Package: inbe.waozi
|
||||
Version: 2.1.26
|
||||
Version: 2.1.27
|
||||
Architecture: arm64
|
||||
Maintainer: Waozi <[email protected]>
|
||||
Click-Version: 0.4
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<binary>inbe</binary>
|
||||
</provides>
|
||||
<releases>
|
||||
<release version="2.1.26" date="2026-10-09"/>
|
||||
<release version="2.1.27" date="2026-10-10"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.1"/>
|
||||
</component>
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "inbe",
|
||||
"title": "Inner Breeze",
|
||||
"version": "2.1.26",
|
||||
"version": "2.1.27",
|
||||
"architecture": "arm64",
|
||||
"framework": "ubuntu-sdk-20.04",
|
||||
"description": "Syncable breathing, meditation, and habit practice app.",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"manifest_version": 3,
|
||||
"name": "Inner Breeze",
|
||||
"short_name": "Inbe",
|
||||
"version": "2.1.26",
|
||||
"version": "2.1.27",
|
||||
"description": "Breathing, meditation, habit tracking, and encrypted sync.",
|
||||
"permissions": [
|
||||
"contextMenus"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<binary>inbe</binary>
|
||||
</provides>
|
||||
<releases>
|
||||
<release version="2.1.26" date="2026-10-09"/>
|
||||
<release version="2.1.27" date="2026-10-10"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.1"/>
|
||||
</component>
|
||||
@@ -22,7 +22,7 @@
|
||||
<binary>inbe</binary>
|
||||
</provides>
|
||||
<releases>
|
||||
<release version="2.1.26" date="2026-10-09"/>
|
||||
<release version="2.1.27" date="2026-10-10"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.1"/>
|
||||
</component>
|
||||
@@ -6,7 +6,7 @@ description: |
|
||||
meditation, and habit tracking with visual and audio cues, meditation
|
||||
timers, habit counters, session history, and optional sync.
|
||||
|
||||
version: '2.1.26'
|
||||
version: '2.1.27'
|
||||
license: BSD-3-Clause
|
||||
base: core22
|
||||
confinement: strict
|
||||
|
||||
@@ -359,6 +359,9 @@ SessionWindow :: struct {
|
||||
system_visible: bool
|
||||
system_screen: s32
|
||||
system_generation: s32
|
||||
// Flips with Android each time the floating window opens back into the
|
||||
// app.
|
||||
system_returned: bool
|
||||
system_last_tick: float64
|
||||
system_elapsed_carry: float64
|
||||
last_tick: float64
|
||||
|
||||
+10
-1
@@ -1446,11 +1446,20 @@ app_update_draw :: (vapp: *void, viewport: Rectangle) {
|
||||
app.session_window.system_available = (picture_state & 1) != 0 &&
|
||||
app.picture_in_picture_enabled != 0
|
||||
app.session_window.system_visible = (picture_state & 2) != 0
|
||||
generation := picture_state >> 2
|
||||
generation := picture_state >> 3
|
||||
if generation != app.session_window.system_generation {
|
||||
app.session_window.system_generation = generation
|
||||
app.session_window.system_last_tick = GetTime()
|
||||
}
|
||||
// Opening the floating window back into the app shows its practice,
|
||||
// not the page that was open behind the practice's in-app window.
|
||||
// Like other window input from outside the frame, the window tick
|
||||
// applies it after the frame has read the current route.
|
||||
returned := (picture_state & 4) != 0
|
||||
if returned != app.session_window.system_returned {
|
||||
app.session_window.system_returned = returned
|
||||
app.session_window.restore_requested = true
|
||||
}
|
||||
if app.session_window.system_visible {
|
||||
app_draw_android_picture_window(app, viewport)
|
||||
return
|
||||
|
||||
@@ -37,6 +37,7 @@ c :: #system_library "c";
|
||||
GetTime :: () -> float64 #foreign c;
|
||||
|
||||
using ButtonEmphasis;
|
||||
using ButtonTone;
|
||||
using ModalType;
|
||||
using ExerciseType;
|
||||
using TextAlign;
|
||||
@@ -48,6 +49,7 @@ SESSION_WINDOW_CLOSE_ID :: 7481
|
||||
SESSION_WINDOW_MAXIMIZE_ID :: 7482
|
||||
SESSION_WINDOW_RESIZE_ID :: 7483
|
||||
SESSION_WINDOW_DETACH_ID :: 7484
|
||||
SESSION_WINDOW_BREATHE_ID :: 7488
|
||||
// Units: the window's starting and smallest sizes, its inner margin, the
|
||||
// row holding its buttons, the lines below the picture and the corner that
|
||||
// resizes it.
|
||||
@@ -59,6 +61,12 @@ SESSION_WINDOW_PADDING :: 8
|
||||
SESSION_WINDOW_BUTTON_ROW :: 40
|
||||
SESSION_WINDOW_TEXT_HEIGHT :: 46
|
||||
SESSION_WINDOW_GRIP :: 32
|
||||
// Units: the height of the window's Breath button and the space beside
|
||||
// its label.
|
||||
SESSION_WINDOW_BREATHE_HEIGHT :: 36
|
||||
SESSION_WINDOW_BREATHE_SPACE :: 32
|
||||
// Seconds between the two taps of a double tap, as on the practice's screen.
|
||||
SESSION_WINDOW_DOUBLE_TAP_SECONDS :: 0.35
|
||||
|
||||
session_window_practice :: (screen: s32) -> s32 {
|
||||
if screen == ScreenMeditation {
|
||||
@@ -273,8 +281,52 @@ session_window_resize :: (app: *InnerBreeze, bounds: Rectangle) {
|
||||
TreeSetDragCapture(session, node, true)
|
||||
}
|
||||
|
||||
// The running practice waits for the person to breathe, as a held breath
|
||||
// does.
|
||||
session_window_can_breathe :: (app: *InnerBreeze, practice: *PracticeDefinition) -> bool {
|
||||
return practice != null && practice.can_breathe != null && practice.breathe != null &&
|
||||
practice.can_breathe(app) != 0
|
||||
}
|
||||
|
||||
// The window's Breath button, centered along the bottom of its picture,
|
||||
// below the held breath's small circle. Returns true when it was pressed.
|
||||
session_window_breathe_button :: (app: *InnerBreeze, bounds: Rectangle) -> bool {
|
||||
label := LocaleText("breath_button")
|
||||
padding := cast(float32)AppScale(SESSION_WINDOW_PADDING)
|
||||
height := cast(float32)AppScale(SESSION_WINDOW_BREATHE_HEIGHT)
|
||||
width := cast(float32)(AppTextWidth(label, AppFontSize()) +
|
||||
AppScale(SESSION_WINDOW_BREATHE_SPACE))
|
||||
if width > bounds.width - padding * 2.0 {
|
||||
width = bounds.width - padding * 2.0
|
||||
}
|
||||
bottom := bounds.y + bounds.height - cast(float32)AppScale(SESSION_WINDOW_TEXT_HEIGHT) - padding
|
||||
button: ButtonProps
|
||||
button.id = SESSION_WINDOW_BREATHE_ID
|
||||
button.bounds = Rectangle.{bounds.x + (bounds.width - width) * 0.5, bottom - height,
|
||||
width, height}
|
||||
button.label = label
|
||||
button.tone = cast(ButtonTone)ButtonToneAccent
|
||||
button.emphasis = cast(ButtonEmphasis)ButtonEmphasisFilled
|
||||
return Button(app.ui.session, button) != 0
|
||||
}
|
||||
|
||||
// A tap on the window while the practice is set to double tap to breathe:
|
||||
// the second tap in quick succession breathes.
|
||||
session_window_breathe_tap :: (app: *InnerBreeze, practice: *PracticeDefinition) {
|
||||
now := GetTime()
|
||||
last := app.breath_tap_last_time
|
||||
if last > 0.0 && now - last <= SESSION_WINDOW_DOUBLE_TAP_SECONDS {
|
||||
app.breath_tap_last_time = 0.0
|
||||
practice.breathe(app)
|
||||
return
|
||||
}
|
||||
app.breath_tap_last_time = now
|
||||
}
|
||||
|
||||
// The running practice's small window: tap or maximize to return, drag to
|
||||
// move, and the X asks to end the practice over the open page.
|
||||
// move, and the X asks to end the practice over the open page. While the
|
||||
// practice waits for a breath, its Breath button or a double tap, as it is
|
||||
// set, breathes right from the window.
|
||||
app_session_window_draw :: (app: *InnerBreeze) {
|
||||
if app == null || app.session_window.screen == ScreenStart ||
|
||||
app_is_session_screen(app.breathing.screen) ||
|
||||
@@ -393,12 +445,29 @@ app_session_window_draw :: (app: *InnerBreeze) {
|
||||
app_session_window_close(app)
|
||||
return
|
||||
}
|
||||
practice := practice_get(session_window_practice(window.screen))
|
||||
can_breathe := session_window_can_breathe(app, practice)
|
||||
double_tap := can_breathe && app.double_tap_to_breathe != 0
|
||||
if !double_tap {
|
||||
app.breath_tap_last_time = 0.0
|
||||
}
|
||||
if can_breathe && !double_tap && session_window_breathe_button(app, bounds) {
|
||||
practice.breathe(app)
|
||||
return
|
||||
}
|
||||
if session_window_exit_prompt(app) {
|
||||
return
|
||||
}
|
||||
if activated && !window.drag_moved {
|
||||
unused app_session_window_restore(app)
|
||||
if !activated || window.drag_moved {
|
||||
return
|
||||
}
|
||||
// Set to double tap, taps on the window are for breathing; maximize
|
||||
// still returns to the practice.
|
||||
if double_tap {
|
||||
session_window_breathe_tap(app, practice)
|
||||
return
|
||||
}
|
||||
unused app_session_window_restore(app)
|
||||
}
|
||||
|
||||
// Shared content for the in-app card, detached desktop window and Android PiP.
|
||||
|
||||
+14
-1
@@ -28,6 +28,8 @@
|
||||
#import, file "../app/assets.zi";
|
||||
#import, file "../app/locale.zi";
|
||||
#import, file "../app/text_buffers.zi";
|
||||
#import, file "../core/device_info.zi";
|
||||
#import, file "../core/version.zi";
|
||||
#import, file "../app/exercise_types.zi";
|
||||
#import, file "../practices/practice_registry.zi";
|
||||
#import, file "../app/account_activity.zi";
|
||||
@@ -78,8 +80,19 @@ AppToolContext :: (app: *InnerBreeze) -> string {
|
||||
AppFeedbackContext :: (app: *InnerBreeze) -> string {
|
||||
out: Vec(u8)
|
||||
// Reports carry diagnostics without copying diary, task or habit contents.
|
||||
BuilderPrint(*out, "{\"screen\":%,\"apps\":%,\"theme\":\"%\",\"scale\":%}",
|
||||
// The version, system and device let the developer check whether a newer
|
||||
// release already fixes the problem.
|
||||
BuilderPrint(*out, "{\"screen\":%,\"apps\":%,\"theme\":\"%\",\"scale\":%",
|
||||
app.breathing.screen, app.enabled_apps & CellsInstalledMask(), AppThemeName(app.theme_id), app.ui_scale_tenths)
|
||||
details: DeviceDetails
|
||||
DeviceDescribe(*details)
|
||||
BuilderPrint(*out, ",\"version\":\"%\",\"platform\":\"%\",\"system\":", VersionString, DevicePlatform())
|
||||
LumiJsonString(*out, DeviceSystem(*details))
|
||||
BuilderPrint(*out, ",\"device\":")
|
||||
LumiJsonString(*out, DeviceModel(*details))
|
||||
BuilderPrint(*out, ",\"package\":")
|
||||
LumiJsonString(*out, DevicePackage(*details))
|
||||
BuilderPrint(*out, "}")
|
||||
return BuilderFinish(out)
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,87 @@ FeedbackEnqueue :: (title: string, message: string, context: string) -> string {
|
||||
return PackageText(value, "")
|
||||
}
|
||||
|
||||
// Earlier hosts stored already-queued reports together in this account's
|
||||
// setting. Keep their IDs and existing delivery tombstones when upgrading.
|
||||
FeedbackMigratePending :: () -> bool {
|
||||
owner := PackageText(AppTextFromCString(storage_user_id_buffer(), 64), "")
|
||||
defer { PackageFree(owner) }
|
||||
statement: *void
|
||||
if SqlitePrepareText(storage_db_handle(),
|
||||
"SELECT value FROM settings WHERE user_id=?1 AND key='lumi_feedback_pending'",
|
||||
-1, *statement, null) != SQLITE_OK {
|
||||
return false
|
||||
}
|
||||
bind_text(statement, 1, owner)
|
||||
document: string
|
||||
if SqliteStep(statement) == SQLITE_ROW {
|
||||
// Read the whole SQLite value, including older multi-report queues
|
||||
// larger than the general setting getter's text buffer.
|
||||
document = PackageText(TextFromCString(SqliteColumnText(statement, 0)), "")
|
||||
}
|
||||
SqliteFinalize(statement)
|
||||
defer { PackageFree(document) }
|
||||
if document.count == 0 {
|
||||
return true
|
||||
}
|
||||
count := ArrayCount(document, 0)
|
||||
end := ValueEnd(document, 0, 0)
|
||||
if count < 0 || end < 0 || Space(document, end) != document.count {
|
||||
return false
|
||||
}
|
||||
if count == 0 {
|
||||
return true
|
||||
}
|
||||
for index: cast(s32)0..count - 1 {
|
||||
if owner != AppTextFromCString(storage_user_id_buffer(), 64) {
|
||||
return false
|
||||
}
|
||||
at := ElementAt(document, 0, index)
|
||||
id_bytes: [65]u8
|
||||
app_bytes: [16]u8
|
||||
id_count := ReadStringText(document, FieldAt(document, at, "id"), id_bytes[:])
|
||||
app_count := ReadStringText(document, FieldAt(document, at, "app_id"), app_bytes[:])
|
||||
if id_count != 64 || app_count != 4 || TextFromBytes(app_bytes[:app_count]) != "inbe" {
|
||||
return false
|
||||
}
|
||||
id := TextFromBytes(id_bytes[:id_count])
|
||||
key := PackageText("cell.feedback.pending.", id)
|
||||
existing := CellRecordRead(key)
|
||||
defer { PackageFree(key); PackageFree(existing) }
|
||||
if existing.count != 0 {
|
||||
if existing == "{\"delivered\":true}" {
|
||||
continue
|
||||
}
|
||||
saved_id: [65]u8
|
||||
saved_count := ReadStringText(existing, FieldAt(existing, 0, "id"), saved_id[:])
|
||||
if saved_count != 64 || TextFromBytes(saved_id[:saved_count]) != id {
|
||||
return false
|
||||
}
|
||||
continue
|
||||
}
|
||||
title: [161]u8
|
||||
message: [4097]u8
|
||||
context: [2049]u8
|
||||
title_count := ReadStringText(document, FieldAt(document, at, "title"), title[:])
|
||||
message_count := ReadStringText(document, FieldAt(document, at, "message"), message[:])
|
||||
context_count := ReadStringText(document, FieldAt(document, at, "context"), context[:])
|
||||
if title_count <= 0 || message_count <= 0 || context_count < 0 ||
|
||||
!FeedbackEnqueueID(TextFromBytes(title[:title_count]),
|
||||
TextFromBytes(message[:message_count]), TextFromBytes(context[:context_count]), id) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if owner != AppTextFromCString(storage_user_id_buffer(), 64) {
|
||||
return false
|
||||
}
|
||||
// A restart after a partial upgrade can safely resume with the same IDs.
|
||||
// Retain the original queue whenever any row could not be preserved.
|
||||
storage_set_setting_text("lumi_feedback_pending", "[]")
|
||||
return storage_setting_text_equals("lumi_feedback_pending", "[]") != 0
|
||||
}
|
||||
|
||||
FeedbackFirst :: () -> string {
|
||||
unused FeedbackMigratePending()
|
||||
statement: *void
|
||||
if SqlitePrepareText(storage_db_handle(), "SELECT value FROM settings WHERE user_id=?1 AND key LIKE 'cell.feedback.pending.%' AND json_extract(value,'$.id') IS NOT NULL ORDER BY updated_at,key LIMIT 1", -1, *statement, null) != SQLITE_OK { return "" }
|
||||
defer { SqliteFinalize(statement) }
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#import, file "../app/assets.zi";
|
||||
#import, file "../practices/practice_actions.zi";
|
||||
#import, file "../storage/storage_core.zi";
|
||||
#import, file "../storage/cell_records.zi";
|
||||
#import, file "../storage/state.zi";
|
||||
#import, file "../storage/delegate_store.zi";
|
||||
#import, file "app_tools.zi";
|
||||
@@ -268,6 +269,49 @@ LumiOnlineAnswer :: (app: *InnerBreeze) -> bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// A stable history key makes failure and receipt notices account-scoped and
|
||||
// idempotent across retries and restarts, using the existing Lumi archive.
|
||||
LumiFeedbackNotice :: (id: string, delivered: bool) -> bool {
|
||||
if id.count != 64 {
|
||||
return false
|
||||
}
|
||||
notice_id := PackageText("feedback-", id)
|
||||
defer { PackageFree(notice_id) }
|
||||
message_id := PackageText(notice_id, ifx delivered then "-delivered" else "-failed")
|
||||
defer { PackageFree(message_id) }
|
||||
message_key := PackageText("cell.lumi.message.", message_id)
|
||||
defer { PackageFree(message_key) }
|
||||
existing := CellRecordRead(message_key)
|
||||
defer { PackageFree(existing) }
|
||||
if existing.count != 0 {
|
||||
return true
|
||||
}
|
||||
report_key := PackageText("cell.feedback.pending.", id)
|
||||
defer { PackageFree(report_key) }
|
||||
report := CellRecordRead(report_key)
|
||||
defer { PackageFree(report) }
|
||||
bytes: [161]u8
|
||||
title := ToolString(report, "title", bytes[:])
|
||||
if title.count == 0 {
|
||||
return false
|
||||
}
|
||||
out: Vec(u8)
|
||||
BuilderPrint(*out, "%\n%", LocaleText(ifx delivered then
|
||||
"lumi_feedback_delivered" else "lumi_feedback_unavailable"), title)
|
||||
message := BuilderFinish(out)
|
||||
defer { PackageFree(message) }
|
||||
if lumi_next_message_id.count != 0 {
|
||||
return false
|
||||
}
|
||||
lumi_next_message_id = message_id
|
||||
saved := LumiStoreAppendCard(message, false, LUMI_CHAT_TEXT, "")
|
||||
lumi_next_message_id = ""
|
||||
if saved && lumi_ui.follow_end {
|
||||
lumi_ui.scroll = 1000000
|
||||
}
|
||||
return saved
|
||||
}
|
||||
|
||||
LumiFeedbackStart :: () -> bool {
|
||||
if StoredAccountMode() == AccountModeDelegate {
|
||||
return false
|
||||
@@ -278,9 +322,13 @@ LumiFeedbackStart :: () -> bool {
|
||||
return false
|
||||
}
|
||||
id := ToolString(body, "id", lumi_feedback_id[:])
|
||||
if id.count != 64 || !BeginStoredRequest(*lumi_online_operation, "https://api.waozi.xyz",
|
||||
if id.count != 64 {
|
||||
return false
|
||||
}
|
||||
if !BeginStoredRequest(*lumi_online_operation, "https://api.waozi.xyz",
|
||||
NetworkTransport(*lumi_online_transfer), "POST", "/api/v1/feedback",
|
||||
body, lumi_online_response[:], false, *lumi_online_session) {
|
||||
unused LumiFeedbackNotice(id, false)
|
||||
return false
|
||||
}
|
||||
lumi_online_stage = 2
|
||||
@@ -340,6 +388,13 @@ app_lumi_pump :: (app: *InnerBreeze) {
|
||||
if !PollStoredOperation(*lumi_online_operation) {
|
||||
return
|
||||
}
|
||||
// A transport callback can switch accounts while polling. Never write
|
||||
// the old account's receipt or notice into the new account's archive.
|
||||
if owner != AppTextFromCString(storage_user_id_buffer(), 64) {
|
||||
LumiOnlineCancel()
|
||||
app_lumi_reset()
|
||||
return
|
||||
}
|
||||
stage := lumi_online_stage
|
||||
lumi_online_stage = 0
|
||||
success := lumi_online_operation.result == cast(s32)AuthResult.AUTH_OK
|
||||
@@ -361,9 +416,19 @@ app_lumi_pump :: (app: *InnerBreeze) {
|
||||
LumiOnlineClearTurn()
|
||||
}
|
||||
unused LumiStoreSave()
|
||||
} else if stage == 2 && success {
|
||||
unused FeedbackDelivered(TextUntilNul(lumi_feedback_id[:]))
|
||||
lumi_feedback_retry = 0
|
||||
} else if stage == 2 {
|
||||
id := TextUntilNul(lumi_feedback_id[:])
|
||||
confirmed := success && LumiFeedbackReceiptMatches(
|
||||
TextUntilNul(lumi_online_response[:]), id)
|
||||
if confirmed {
|
||||
// Persist the receipt notice before removing the outbox item.
|
||||
// A local write failure leaves delivery safe to retry.
|
||||
if LumiFeedbackNotice(id, true) && FeedbackDelivered(id) {
|
||||
lumi_feedback_retry = 0
|
||||
}
|
||||
} else {
|
||||
unused LumiFeedbackNotice(id, false)
|
||||
}
|
||||
} else if stage == 3 && success {
|
||||
LumiFeedbackReplies()
|
||||
unused LumiStoreSave()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#import "json_scan"
|
||||
#import "byte_text_linux"
|
||||
|
||||
LumiResponseMessageAt :: (document: string) -> s32 {
|
||||
end := ValueEnd(document, 0, 0)
|
||||
@@ -7,3 +8,18 @@ LumiResponseMessageAt :: (document: string) -> s32 {
|
||||
}
|
||||
return FieldAt(document, 0, "message")
|
||||
}
|
||||
|
||||
// HTTP success alone is not a feedback receipt. Daochi acknowledges the exact
|
||||
// report ID as a JSON string, optionally followed by JSON whitespace.
|
||||
LumiFeedbackReceiptMatches :: (document: string, id: string) -> bool {
|
||||
if id.count != 64 {
|
||||
return false
|
||||
}
|
||||
end := ValueEnd(document, 0, 0)
|
||||
if end < 0 || Space(document, end) != document.count {
|
||||
return false
|
||||
}
|
||||
bytes: [65]u8
|
||||
count := ReadStringText(document, Space(document, 0), bytes[:])
|
||||
return count == 64 && TextFromBytes(bytes[:count]) == id
|
||||
}
|
||||
@@ -3,7 +3,7 @@ PackageBundledVersion :: (index: s32) -> string {
|
||||
if index < 0 || index >= 6 {
|
||||
return ""
|
||||
}
|
||||
versions: [6]string = .["2.1.20", "1.0.3", "1.0.3", "1.1.3", "1.1.5", "1.3.3"]
|
||||
versions: [6]string = .["2.1.22", "1.0.3", "1.0.3", "1.1.3", "1.1.5", "1.3.3"]
|
||||
return versions[index]
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ PackageBundledSequence :: (index: s32) -> s32 {
|
||||
if index < 0 || index >= 6 {
|
||||
return 0
|
||||
}
|
||||
sequences: [6]s32 = .[17, 4, 4, 5, 7, 10]
|
||||
sequences: [6]s32 = .[19, 4, 4, 5, 7, 10]
|
||||
return sequences[index]
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
// The phone or computer a Lumi report comes from and this build's version, so
|
||||
// the developer can tell whether a newer release already fixes the problem.
|
||||
// Only model, system and package names: never identifiers or user data.
|
||||
#import "c_string"
|
||||
#import "byte_text_linux"
|
||||
|
||||
DEVICE_ANDROID :: #defined(ANDROID_BUILD) || #defined(PLATFORM_ANDROID) || #defined(__ANDROID__)
|
||||
DEVICE_WEB :: #defined(PLATFORM_WEB) || #defined(__EMSCRIPTEN__)
|
||||
DEVICE_WINDOWS :: #defined(_WIN32)
|
||||
DEVICE_APPLE :: #defined(__APPLE__)
|
||||
|
||||
DeviceDetails :: struct {
|
||||
system: [128]u8
|
||||
device: [160]u8
|
||||
package: [96]u8
|
||||
sizes: [3]s32
|
||||
}
|
||||
|
||||
device_c :: #system_library "c";
|
||||
|
||||
#if !DEVICE_WEB && !DEVICE_WINDOWS {
|
||||
DeviceOpen :: (path: *u8, mode: *u8) -> *void #foreign device_c "fopen";
|
||||
DeviceRead :: (buffer: *u8, size: u64, count: u64, file: *void) -> u64 #foreign device_c "fread";
|
||||
DeviceClose :: (file: *void) -> s32 #foreign device_c "fclose";
|
||||
|
||||
// A small system file's first bytes, or 0 when it cannot be read.
|
||||
DeviceFile :: (path: string, output: []u8) -> s32 {
|
||||
name: [96]u8
|
||||
mode: [4]u8
|
||||
if !CopyCString(path, name[:]) || !CopyCString("rb", mode[:]) {
|
||||
return 0
|
||||
}
|
||||
file := DeviceOpen(*name[0], *mode[0])
|
||||
if file == null {
|
||||
return 0
|
||||
}
|
||||
count := DeviceRead(*output[0], 1, cast(u64)output.count, file)
|
||||
unused DeviceClose(file)
|
||||
return cast(s32)count
|
||||
}
|
||||
}
|
||||
|
||||
#if DEVICE_ANDROID {
|
||||
DeviceProperty :: (name: *u8, value: *u8) -> s32 #foreign device_c "__system_property_get";
|
||||
|
||||
DeviceAndroidProperty :: (name: string, output: []u8) -> string {
|
||||
key: [48]u8
|
||||
// PROP_VALUE_MAX is 92 bytes including its terminator.
|
||||
if output.count < 92 || !CopyCString(name, key[:]) {
|
||||
return ""
|
||||
}
|
||||
size := DeviceProperty(*key[0], *output[0])
|
||||
if size <= 0 || cast(s64)size >= output.count {
|
||||
return ""
|
||||
}
|
||||
return TextFromBytes(output[:size])
|
||||
}
|
||||
}
|
||||
|
||||
// Printable text only, so a report stays one readable line per field.
|
||||
DeviceAppend :: (target: []u8, size: *s32, value: string) {
|
||||
for byte: value {
|
||||
if size.* >= cast(s32)target.count - 1 {
|
||||
return
|
||||
}
|
||||
if byte >= cast(u8)32 && byte != cast(u8)127 {
|
||||
target[size.*] = byte
|
||||
size.* += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DeviceStartsWithFold :: (value: string, prefix: string) -> bool {
|
||||
if prefix.count == 0 || prefix.count > value.count {
|
||||
return false
|
||||
}
|
||||
for index: cast(s64)0..prefix.count - 1 {
|
||||
a := value[index]
|
||||
b := prefix[index]
|
||||
if a >= cast(u8)65 && a <= cast(u8)90 { a += cast(u8)32 }
|
||||
if b >= cast(u8)65 && b <= cast(u8)90 { b += cast(u8)32 }
|
||||
if a != b {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
DevicePlatform :: () -> string {
|
||||
platform := "linux"
|
||||
#if DEVICE_ANDROID {
|
||||
platform = "android"
|
||||
}
|
||||
#if DEVICE_WEB {
|
||||
platform = "web"
|
||||
}
|
||||
#if DEVICE_WINDOWS {
|
||||
platform = "windows"
|
||||
}
|
||||
#if DEVICE_APPLE {
|
||||
platform = "macos"
|
||||
}
|
||||
return platform
|
||||
}
|
||||
|
||||
// Views into the caller's details, which outlive the returned text.
|
||||
DeviceSystem :: (details: *DeviceDetails) -> string {
|
||||
return TextFromBytes(BytesFromPointer(*details.system[0], cast(u64)details.sizes[0]))
|
||||
}
|
||||
DeviceModel :: (details: *DeviceDetails) -> string {
|
||||
return TextFromBytes(BytesFromPointer(*details.device[0], cast(u64)details.sizes[1]))
|
||||
}
|
||||
DevicePackage :: (details: *DeviceDetails) -> string {
|
||||
return TextFromBytes(BytesFromPointer(*details.package[0], cast(u64)details.sizes[2]))
|
||||
}
|
||||
|
||||
// Linux: os-release's PRETTY_NAME, unquoted.
|
||||
DeviceReleaseName :: (text: string) -> string {
|
||||
at: s64 = 0
|
||||
while at < text.count {
|
||||
end := at
|
||||
while end < text.count && text[end] != cast(u8)10 { end += 1 }
|
||||
line := text[at:end]
|
||||
if line.count > 12 && DeviceStartsWithFold(line, "PRETTY_NAME=") {
|
||||
value := line[12:]
|
||||
if value.count >= 2 && (value[0] == cast(u8)34 || value[0] == cast(u8)39) && value[value.count - 1] == value[0] {
|
||||
value = value[1:value.count - 1]
|
||||
}
|
||||
return value
|
||||
}
|
||||
at = end + 1
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
DeviceDescribe :: (details: *DeviceDetails) {
|
||||
details.* = .{}
|
||||
#if DEVICE_ANDROID {
|
||||
manufacturer: [96]u8
|
||||
model: [96]u8
|
||||
release: [96]u8
|
||||
sdk: [96]u8
|
||||
maker := DeviceAndroidProperty("ro.product.manufacturer", manufacturer[:])
|
||||
name := DeviceAndroidProperty("ro.product.model", model[:])
|
||||
if maker.count > 0 && !DeviceStartsWithFold(name, maker) {
|
||||
DeviceAppend(details.device[:], *details.sizes[1], maker)
|
||||
DeviceAppend(details.device[:], *details.sizes[1], " ")
|
||||
}
|
||||
DeviceAppend(details.device[:], *details.sizes[1], name)
|
||||
DeviceAppend(details.system[:], *details.sizes[0], "Android ")
|
||||
DeviceAppend(details.system[:], *details.sizes[0], DeviceAndroidProperty("ro.build.version.release", release[:]))
|
||||
level := DeviceAndroidProperty("ro.build.version.sdk", sdk[:])
|
||||
if level.count > 0 {
|
||||
DeviceAppend(details.system[:], *details.sizes[0], " (SDK ")
|
||||
DeviceAppend(details.system[:], *details.sizes[0], level)
|
||||
DeviceAppend(details.system[:], *details.sizes[0], ")")
|
||||
}
|
||||
// The process name is the installed package, which tells a debug
|
||||
// build (xyz.waozi.inbe.debug) from a release.
|
||||
command: [96]u8
|
||||
read := DeviceFile("/proc/self/cmdline", command[:])
|
||||
end: s32 = 0
|
||||
while end < read && command[end] != 0 { end += 1 }
|
||||
DeviceAppend(details.package[:], *details.sizes[2], TextFromBytes(command[:end]))
|
||||
return
|
||||
}
|
||||
#if DEVICE_WEB {
|
||||
DeviceAppend(details.system[:], *details.sizes[0], "Web browser")
|
||||
return
|
||||
}
|
||||
#if DEVICE_WINDOWS {
|
||||
DeviceAppend(details.system[:], *details.sizes[0], "Windows")
|
||||
return
|
||||
}
|
||||
#if DEVICE_APPLE {
|
||||
DeviceAppend(details.system[:], *details.sizes[0], "macOS")
|
||||
return
|
||||
}
|
||||
#if !DEVICE_ANDROID && !DEVICE_WEB && !DEVICE_WINDOWS && !DEVICE_APPLE {
|
||||
release: [1024]u8
|
||||
read := DeviceFile("/etc/os-release", release[:])
|
||||
name := DeviceReleaseName(TextFromBytes(release[:read]))
|
||||
DeviceAppend(details.system[:], *details.sizes[0], ifx name.count > 0 then name else "Linux")
|
||||
vendor: [96]u8
|
||||
product: [96]u8
|
||||
vendor_size := DeviceFile("/sys/devices/virtual/dmi/id/sys_vendor", vendor[:])
|
||||
product_size := DeviceFile("/sys/devices/virtual/dmi/id/product_name", product[:])
|
||||
while vendor_size > 0 && vendor[vendor_size - 1] <= cast(u8)32 { vendor_size -= 1 }
|
||||
while product_size > 0 && product[product_size - 1] <= cast(u8)32 { product_size -= 1 }
|
||||
DeviceAppend(details.device[:], *details.sizes[1], TextFromBytes(vendor[:vendor_size]))
|
||||
if vendor_size > 0 && product_size > 0 {
|
||||
DeviceAppend(details.device[:], *details.sizes[1], " ")
|
||||
}
|
||||
DeviceAppend(details.device[:], *details.sizes[1], TextFromBytes(product[:product_size]))
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
|
||||
#define APP_VERSION_MAJOR 2
|
||||
#define APP_VERSION_MINOR 1
|
||||
#define APP_VERSION_PATCH 26
|
||||
#define APP_VERSION_STRING "2.1.26"
|
||||
#define APP_VERSION_PATCH 27
|
||||
#define APP_VERSION_STRING "2.1.27"
|
||||
|
||||
#endif
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
// Generated by update_version.sh from CHANGELOG.md. Do not edit by hand.
|
||||
VersionMajor :: 2
|
||||
VersionMinor :: 1
|
||||
VersionPatch :: 26
|
||||
VersionString :: "2.1.26"
|
||||
VersionPatch :: 27
|
||||
VersionString :: "2.1.27"
|
||||
@@ -5,6 +5,7 @@
|
||||
#import "async_client"
|
||||
#import "c_string"
|
||||
#import "text_buffer"
|
||||
#import "text"
|
||||
|
||||
AndroidTransfer :: struct {
|
||||
handle: s32
|
||||
@@ -136,7 +137,8 @@ StartAndroidTransfer :: (context: *void, request: HttpRequest,
|
||||
arguments[0].reference = NetworkBytes(*session, request.method)
|
||||
arguments[1].reference = NetworkBytes(*session, request.url)
|
||||
arguments[2].integer = cast(s32)output.count
|
||||
arguments[3].integer = 20000
|
||||
// Lumi's model answers may take longer; the same deadlines as desktop.
|
||||
arguments[3].integer = ifx ContainsFoldASCII(request.url, "/api/v1/chat/completions") then 45000 else 20000
|
||||
if arguments[0].reference == null || arguments[1].reference == null {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ PracticeDrawWindowFn :: #type (app: *InnerBreeze, picture: Rectangle, status: []
|
||||
// the practice has ended.
|
||||
PracticeExitPromptFn :: #type (app: *InnerBreeze) -> s32;
|
||||
PRACTICE_EXIT_ENDED :: 2
|
||||
// Whether the practice waits for the person to breathe, as a held breath
|
||||
// does: 1 while its screen offers its Breath button or a double tap.
|
||||
PracticeCanBreatheFn :: #type (app: *InnerBreeze) -> s32;
|
||||
|
||||
PracticeDefinition :: struct {
|
||||
id: ExerciseType
|
||||
@@ -68,6 +71,8 @@ PracticeDefinition :: struct {
|
||||
background_stop: PracticeVoidFn
|
||||
advance_elapsed: PracticeAdvanceElapsedFn
|
||||
draw_window: PracticeDrawWindowFn
|
||||
can_breathe: PracticeCanBreatheFn
|
||||
breathe: PracticeVoidFn
|
||||
}
|
||||
|
||||
practices: [EXERCISE_COUNT]PracticeDefinition;
|
||||
@@ -92,6 +97,8 @@ practice_initialize_definitions :: () {
|
||||
whm.request_exit = session_request_exit
|
||||
whm.exit_prompt = session_handle_exit_modal
|
||||
whm.draw_window = session_draw_window
|
||||
whm.can_breathe = session_can_breathe
|
||||
whm.breathe = session_breathe
|
||||
practices[0] = whm
|
||||
|
||||
meditation: PracticeDefinition
|
||||
|
||||
@@ -984,6 +984,23 @@ session_draw_window :: (app: *InnerBreeze, picture: Rectangle, status: []u8) ->
|
||||
return AppTextFromCString(*status[0], cast(s32)status.count)
|
||||
}
|
||||
|
||||
// The held breath waits for the Breath button, or a double tap, as on the
|
||||
// screen.
|
||||
session_can_breathe :: (app: *InnerBreeze) -> s32 {
|
||||
if app_session_screen(app) != ScreenSession {
|
||||
return 0
|
||||
}
|
||||
return ifx (app.breathing.phase == BreathPhaseHold) then (1) else (0)
|
||||
}
|
||||
|
||||
// Ends the held breath, as the screen's Breath button does.
|
||||
session_breathe :: (app: *InnerBreeze) {
|
||||
if session_can_breathe(app) == 0 {
|
||||
return
|
||||
}
|
||||
finish_hold(app)
|
||||
}
|
||||
|
||||
session_draw_inbe :: (app: *InnerBreeze, center_x: s32, center_y: s32) {
|
||||
radius: float32 = BreathDrawRadiusAt(app.breathing,
|
||||
cast(float32)whm_elapsed_remainder)
|
||||
|
||||
@@ -8,7 +8,6 @@ c :: #system_library "c";
|
||||
|
||||
// The layout of raylib's FilePathList, which the host returns by value.
|
||||
LegacyPaths :: struct {
|
||||
capacity: u32
|
||||
count: u32
|
||||
paths: **u8
|
||||
}
|
||||
|
||||
@@ -144,10 +144,11 @@ public final class AndroidHttpTransportTest {
|
||||
require(transport.poll(id) == 0 && transport.response(id) == null,
|
||||
"cancel prevents late publication");
|
||||
id = request(transport, "GET", base + "/missing", 64, 100, new byte[0]);
|
||||
require(waitFor(transport, id) == 404, "orphan initially completes");
|
||||
require(waitFor(transport, id) == 404, "uncollected response initially completes");
|
||||
Thread.sleep(150);
|
||||
require(transport.poll(id) == 0 && transport.response(id) == null,
|
||||
"deadline reclaims completed response if caller lost its JNI handle");
|
||||
require(transport.poll(id) == 404 && Arrays.equals(transport.response(id), bytes("missing")),
|
||||
"completed response waits past its deadline for a paused caller");
|
||||
int uncollected = id;
|
||||
id = request(transport, "GET", secureBase, 64, 1000, new byte[0]);
|
||||
require(waitFor(transport, id) == 0, "reject untrusted certificate");
|
||||
transport.cancel(id);
|
||||
@@ -167,10 +168,15 @@ public final class AndroidHttpTransportTest {
|
||||
"create abandoned configuration");
|
||||
Thread.sleep(50);
|
||||
int[] handles = new int[8];
|
||||
for (int index = 0; index < handles.length; index++) {
|
||||
for (int index = 0; index < handles.length - 1; index++) {
|
||||
handles[index] = transport.create(bytes("GET"), bytes(base), 64, 1000);
|
||||
require(handles[index] > 0, "bounded request slot");
|
||||
}
|
||||
require(transport.poll(uncollected) == 404, "uncollected response keeps a free slot's place");
|
||||
handles[handles.length - 1] = transport.create(bytes("GET"), bytes(base), 64, 1000);
|
||||
require(handles[handles.length - 1] > 0 && transport.poll(uncollected) == 0 &&
|
||||
transport.response(uncollected) == null,
|
||||
"a needed slot reclaims a response left uncollected past its deadline");
|
||||
require(transport.create(bytes("GET"), bytes(base), 64, 1000) == 0, "slot cap");
|
||||
for (int handle : handles) {
|
||||
transport.cancel(handle);
|
||||
|
||||
@@ -53,6 +53,7 @@ network_state: s32 = -1;
|
||||
network_length: s32 = 3;
|
||||
network_cancelled: s32;
|
||||
network_header_failed: bool;
|
||||
network_timeout: s32;
|
||||
locale_preferences: [64]u8;
|
||||
startup_commands: [16]s8;
|
||||
startup_command_count: s32;
|
||||
@@ -263,7 +264,8 @@ FakeInteger :: (env: *JniEnv, object: *void, method: *void,
|
||||
unused object
|
||||
unused method
|
||||
if CStringEquals(*method_name[0], "httpCreate") {
|
||||
Require(arguments[2].integer == 64 && arguments[3].integer == 20000, 91)
|
||||
Require(arguments[2].integer == 64, 91)
|
||||
network_timeout = arguments[3].integer
|
||||
return 71
|
||||
}
|
||||
if CStringEquals(*method_name[0], "httpPoll") {
|
||||
@@ -656,7 +658,7 @@ main :: () -> s32 {
|
||||
request.content_type = "application/json"
|
||||
request.body = "{}"
|
||||
request.token = "token"
|
||||
Require(transport.start(transport.context, request, output[:]), 93)
|
||||
Require(transport.start(transport.context, request, output[:]) && network_timeout == 20000, 93)
|
||||
Require(!transport.start(transport.context, request, output[:]), 94)
|
||||
Require(transport.poll(transport.context, *http_status) == -1, 95)
|
||||
network_state = 404
|
||||
@@ -676,6 +678,10 @@ main :: () -> s32 {
|
||||
transport.cancel(transport.context)
|
||||
Require(transfer.handle == 0 && transfer.output.count == 0 &&
|
||||
network_cancelled == 4 && frame_count == 0, 101)
|
||||
request.url = "https://example.invalid/api/v1/chat/completions"
|
||||
Require(transport.start(transport.context, request, output[:]) && network_timeout == 45000, 115)
|
||||
transport.cancel(transport.context)
|
||||
Require(transfer.handle == 0 && network_cancelled == 5, 116)
|
||||
before_startup_calls := void_calls
|
||||
AndroidStartupComplete()
|
||||
Require(void_calls == before_startup_calls + 1 &&
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// Lumi reports name the device, system and version; never identifiers.
|
||||
#import "c_string"
|
||||
#import "byte_text_linux"
|
||||
#import, file "../src/core/device_info.zi";
|
||||
#import, file "../src/core/version.zi";
|
||||
|
||||
Fail :: (message: string) -> s32 { print("FAIL %\n", message); return 1 }
|
||||
|
||||
Check :: () -> s32 {
|
||||
if DeviceReleaseName("NAME=Debian\nPRETTY_NAME=\"Debian GNU/Linux 13 (trixie)\"\nID=debian\n") != "Debian GNU/Linux 13 (trixie)" { return Fail("os-release name") }
|
||||
if DeviceReleaseName("ID=arch\n") != "" { return Fail("missing os-release name") }
|
||||
if !DeviceStartsWithFold("Google Pixel 3a", "google") || DeviceStartsWithFold("Pixel", "Google") { return Fail("maker prefix") }
|
||||
details: DeviceDetails
|
||||
DeviceDescribe(*details)
|
||||
if DevicePlatform() != "linux" || DeviceSystem(*details).count == 0 { return Fail("desktop system") }
|
||||
for byte: DeviceModel(*details) { if byte < cast(u8)32 { return Fail("control byte in device") } }
|
||||
clipped: [8]u8
|
||||
size: s32 = 0
|
||||
DeviceAppend(clipped[:], *size, "a\nbcdefghijk")
|
||||
if TextFromBytes(clipped[:size]) != "abcdefg" { return Fail("bounded printable append") }
|
||||
print("device: % · % · %\n", DeviceModel(*details), DeviceSystem(*details), VersionString)
|
||||
return 0
|
||||
}
|
||||
|
||||
Main :: () -> s32 { return Check() }
|
||||
@@ -0,0 +1,15 @@
|
||||
#include "storage/legacy_session_files.h"
|
||||
#include "raylib.h"
|
||||
#include <stddef.h>
|
||||
|
||||
/* Check the native boundary, rather than repeating the Ziran layout in a mock. */
|
||||
_Static_assert(sizeof(LegacyPaths) == sizeof(FilePathList),
|
||||
"LegacyPaths must match raylib's FilePathList size");
|
||||
_Static_assert(_Alignof(LegacyPaths) == _Alignof(FilePathList),
|
||||
"LegacyPaths must match raylib's FilePathList alignment");
|
||||
_Static_assert(offsetof(LegacyPaths, count) == offsetof(FilePathList, count),
|
||||
"LegacyPaths must read raylib's real entry count");
|
||||
_Static_assert(offsetof(LegacyPaths, paths) == offsetof(FilePathList, paths),
|
||||
"LegacyPaths must read raylib's real path pointer");
|
||||
_Static_assert(sizeof(((LegacyPaths *)0)->count) == sizeof(((FilePathList *)0)->count),
|
||||
"LegacyPaths must match raylib's entry count width");
|
||||
@@ -17,6 +17,9 @@ mkdir -p "$work/generated"
|
||||
"$bin/zi2c" --no-main --root "$root/src" \
|
||||
--module-path "$root/build/packages/ziran/std" \
|
||||
-o "$work/generated" "$root/src/storage/legacy_session_zip.zi"
|
||||
"${CC:-cc}" -std=c11 -fsyntax-only -I"$root/build/packages/ziran/include" \
|
||||
-I"$work/generated" -I"$root/build/packages/raylib/src" \
|
||||
"$root/tests/legacy_session_paths_abi_test.c"
|
||||
"${CC:-cc}" -std=c11 -O0 -I"$root/build/packages/ziran/include" \
|
||||
-I"$work/generated" "$root/tests/legacy_session_zi_test.c" \
|
||||
"$work/generated/c_string.c" \
|
||||
|
||||
@@ -29,20 +29,37 @@ with tempfile.TemporaryDirectory(prefix='inbe-emphasis-') as directory:
|
||||
app_used_habits='1', app_used_practices='1', app_used_diary='1',
|
||||
main_tab='4', language='en', language_setup_done='1', apps_setup_done='1',
|
||||
lumi_introduced='1', cells_auto_update='0', tutorial_seen='1',
|
||||
habits_guide_seen='1', lumi_chat=json.dumps(history))
|
||||
habits_guide_seen='1', lumi_archive_migrated='0', lumi_chat=json.dumps(history))
|
||||
for key, value in settings.items():
|
||||
db.execute('INSERT INTO settings(user_id,key,value,updated_at) VALUES(?,?,?,1) '
|
||||
'ON CONFLICT(user_id,key) DO UPDATE SET value=excluded.value', (user,key,value))
|
||||
with application(profile, 'emphasis') as window:
|
||||
assert all(any(row['text'] == seeded['text'] for row in chat(profile))
|
||||
for seeded in history), 'Seeded emphasis replies were not loaded'
|
||||
capture(window, 'bold-replies')
|
||||
suggestion = 'Suggestion: add a weekly habit reminder'
|
||||
send(window, profile, suggestion)
|
||||
reports = json.loads(query(profile, "SELECT value FROM settings WHERE key='lumi_feedback_pending'")[0][0])
|
||||
tap(window, 490, 676)
|
||||
command('xdotool', 'type', '--clearmodifiers', '--delay', '18', suggestion)
|
||||
command('xdotool', 'keydown', '--clearmodifiers', 'Return')
|
||||
time.sleep(0.15)
|
||||
command('xdotool', 'keyup', 'Return')
|
||||
wait_for(lambda: any(row.get('kind', 0) == 3 for row in chat(profile)),
|
||||
'Feedback approval card was not saved')
|
||||
pending_sql = ("SELECT value FROM settings WHERE key LIKE 'cell.feedback.pending.%' "
|
||||
"AND json_extract(value,'$.id') IS NOT NULL")
|
||||
assert query(profile, pending_sql) == [], 'Feedback queued before Yes approval'
|
||||
capture(window, 'suggestion-approval')
|
||||
tap_rendered_button(window, 'Yes')
|
||||
wait_for(lambda: len(query(profile, pending_sql)) == 1,
|
||||
'Approved feedback was not saved in the outbox')
|
||||
reports = [json.loads(row[0]) for row in query(profile, pending_sql)]
|
||||
assert len(reports) == 1 and reports[0]['message'] == suggestion
|
||||
assert reports[0]['title'] == suggestion
|
||||
assert chat(profile)[-1]['text'].strip() == 'Saved your feedback for the developer.', chat(profile)[-1]
|
||||
saved = 'Saved on this device, waiting to send to the developer inbox. Delivery needs an Inner Breeze account and internet access.'
|
||||
wait_for(lambda: chat(profile)[-1]['text'].strip() == saved,
|
||||
'Lumi did not explain that delivery is still pending')
|
||||
capture(window, 'suggestion-feedback')
|
||||
with application(profile, 'emphasis-restart'):
|
||||
reports = json.loads(query(profile, "SELECT value FROM settings WHERE key='lumi_feedback_pending'")[0][0])
|
||||
reports = [json.loads(row[0]) for row in query(profile, pending_sql)]
|
||||
assert len(reports) == 1 and reports[0]['message'] == suggestion
|
||||
print('Lumi emphasis and suggestion feedback: real UI, durable outbox and restart passed')
|
||||
@@ -0,0 +1,298 @@
|
||||
// Real account storage and feedback pump; only the HTTP transport is synthetic.
|
||||
#import, file "../src/cells/lumi_online.zi";
|
||||
#import, file "../src/cells/feedback_store.zi";
|
||||
#import, file "../src/cells/lumi_store.zi";
|
||||
#import, file "../src/cells/package_files.zi";
|
||||
#import, file "../src/app/app_types.zi";
|
||||
#import, file "../src/app/text_buffers.zi";
|
||||
#import, file "../src/storage/account_types.zi";
|
||||
#import, file "../src/storage/db.zi";
|
||||
#import, file "../src/storage/state.zi";
|
||||
#import, file "../src/storage/storage_core.zi";
|
||||
#import, file "../src/storage/cell_records.zi";
|
||||
#import, file "../src/storage/sync_async.zi";
|
||||
#import, file "../src/storage/sync_crypto_random.zi";
|
||||
#import, file "../src/storage/sync_crypto.zi";
|
||||
#import, file "../src/storage/sync_account_crypto.zi";
|
||||
#import, file "../src/storage/sync_account.zi";
|
||||
#import, file "storage_test_support.zi";
|
||||
#import "async_client"
|
||||
#import "net_http"
|
||||
#import "text_buffer"
|
||||
#import "wire"
|
||||
#import "transaction"
|
||||
#import "vec"
|
||||
#import "text"
|
||||
#import "byte_text_linux"
|
||||
|
||||
c :: #system_library "c";
|
||||
TestNow :: (out: *s64) -> s64 #foreign c "time";
|
||||
|
||||
owner: SyncAccount;
|
||||
feedback_status: s32 = 503;
|
||||
feedback_response: string = "{\"error\":\"feedback unavailable\"}";
|
||||
submissions: s32;
|
||||
start_fails: bool;
|
||||
switch_in_poll: bool;
|
||||
switch_report: string;
|
||||
|
||||
FakeStart :: (context: *void, request: HttpRequest, output: []u8) -> bool {
|
||||
unused context
|
||||
challenge_url := "https://api.waozi.xyz/api/v1/sync/challenge?user_id="
|
||||
if request.url.count == challenge_url.count + 64 && request.url[:challenge_url.count] == challenge_url {
|
||||
return AppCopyText("{\"nonce\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"}", output)
|
||||
}
|
||||
if request.url == "https://api.waozi.xyz/api/v1/sync/login" {
|
||||
writer: Writer = .{output, 0, true}
|
||||
writer = WriteText(writer, "{\"auth_token\":\"synthetic-feedback-token\",\"expires_in_seconds\":3600,\"server_time\":")
|
||||
writer = WriteDecimal(writer, TestNow(null))
|
||||
writer = WriteByte(writer, cast(u8)125)
|
||||
return writer.valid
|
||||
}
|
||||
if request.url == "https://api.waozi.xyz/api/v1/account/devices" {
|
||||
return AppCopyText("true", output)
|
||||
}
|
||||
check_true("only approved feedback reaches HTTP", request.method == "POST" &&
|
||||
request.url == "https://api.waozi.xyz/api/v1/feedback")
|
||||
submissions += 1
|
||||
if start_fails {
|
||||
return false
|
||||
}
|
||||
return AppCopyText(feedback_response, output)
|
||||
}
|
||||
|
||||
FakePoll :: (context: *void, status: *s32) -> s32 {
|
||||
unused context
|
||||
status.* = ifx lumi_online_operation.request.stage == 3 then feedback_status else 200
|
||||
if switch_in_poll && lumi_online_operation.request.stage == 3 {
|
||||
switch_in_poll = false
|
||||
unused AppCopyText("different-account", g_storage.user_id[:])
|
||||
check_true("other account queues its own report", FeedbackEnqueueID(
|
||||
"Other account", "A different account's feedback", "", switch_report))
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
FakeCancel :: (context: *void) {
|
||||
unused context
|
||||
}
|
||||
|
||||
#program_export
|
||||
FeedbackTestTransport :: () -> AsyncTransport {
|
||||
return AsyncTransport.{null, FakeStart, FakePoll, FakeCancel}
|
||||
}
|
||||
|
||||
Attempt :: (app: *InnerBreeze) {
|
||||
lumi_feedback_retry = 0
|
||||
lumi_reply_retry = TestNow(null) + 3600
|
||||
app_lumi_pump(app)
|
||||
for step: cast(s32)0..19 {
|
||||
if !lumi_online_operation.active {
|
||||
break
|
||||
}
|
||||
app_lumi_pump(app)
|
||||
}
|
||||
check_true("feedback attempt completes", !lumi_online_operation.active)
|
||||
}
|
||||
|
||||
Pending :: () -> bool {
|
||||
value := FeedbackFirst()
|
||||
defer { PackageFree(value) }
|
||||
return value.count != 0
|
||||
}
|
||||
|
||||
LegacyReport :: (out: *Vec(u8), id: string, title: string, message: string, context: string) {
|
||||
BuilderPrint(out, "{\"id\":")
|
||||
LumiJsonString(out, id)
|
||||
BuilderPrint(out, ",\"app_id\":\"inbe\",\"title\":")
|
||||
LumiJsonString(out, title)
|
||||
BuilderPrint(out, ",\"message\":")
|
||||
LumiJsonString(out, message)
|
||||
BuilderPrint(out, ",\"context\":")
|
||||
LumiJsonString(out, context)
|
||||
BuilderPrint(out, "}")
|
||||
}
|
||||
|
||||
LegacyOutboxChecks :: (root: string, delivered_id: string) {
|
||||
first_id := "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
|
||||
second_id := "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
|
||||
foreign_id := "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
|
||||
message_out: Vec(u8)
|
||||
for index: cast(s32)0..4095 {
|
||||
BuilderPrint(*message_out, "m")
|
||||
}
|
||||
message := BuilderFinish(message_out)
|
||||
defer { PackageFree(message) }
|
||||
context_out: Vec(u8)
|
||||
for index: cast(s32)0..2047 {
|
||||
BuilderPrint(*context_out, "c")
|
||||
}
|
||||
context := BuilderFinish(context_out)
|
||||
defer { PackageFree(context) }
|
||||
out: Vec(u8)
|
||||
BuilderPrint(*out, "[")
|
||||
LegacyReport(*out, delivered_id, "Already received", "Do not send twice", "")
|
||||
BuilderPrint(*out, ",")
|
||||
LegacyReport(*out, first_id, "Earlier queued report", message, context)
|
||||
BuilderPrint(*out, ",")
|
||||
LegacyReport(*out, second_id, "Another queued report", message, context)
|
||||
BuilderPrint(*out, "]")
|
||||
legacy := BuilderFinish(out)
|
||||
defer { PackageFree(legacy) }
|
||||
check_true("older outbox exceeds the general getter buffer", legacy.count > 8192)
|
||||
storage_set_setting_text("lumi_feedback_pending", legacy)
|
||||
check_true("older database fixture saves the complete outbox",
|
||||
storage_setting_text_equals("lumi_feedback_pending", legacy) != 0)
|
||||
LumiStoreReset()
|
||||
storage_close()
|
||||
check_true("older database reopens", storage_init(root) != 0)
|
||||
check_true("older queued feedback is recovered", Pending())
|
||||
check_true("legacy outbox clears only after preserving all rows",
|
||||
storage_setting_text_equals("lumi_feedback_pending", "[]") != 0)
|
||||
first_key := PackageText("cell.feedback.pending.", first_id)
|
||||
second_key := PackageText("cell.feedback.pending.", second_id)
|
||||
delivered_key := PackageText("cell.feedback.pending.", delivered_id)
|
||||
defer { PackageFree(first_key); PackageFree(second_key); PackageFree(delivered_key) }
|
||||
first := CellRecordRead(first_key)
|
||||
second := CellRecordRead(second_key)
|
||||
delivered := CellRecordRead(delivered_key)
|
||||
defer { PackageFree(first); PackageFree(second); PackageFree(delivered) }
|
||||
check_true("large reports retain their IDs, message and context",
|
||||
contains(first, first_id) && contains(first, message) && contains(first, context) &&
|
||||
contains(second, second_id) && contains(second, message) && contains(second, context))
|
||||
check_true("upgrade never resurrects received feedback", delivered == "{\"delivered\":true}")
|
||||
check_true("recovered report can be marked received", FeedbackDelivered(first_id))
|
||||
storage_set_setting_text("lumi_feedback_pending", legacy)
|
||||
check_true("replayed legacy data keeps the remaining pending report", Pending())
|
||||
tombstone := CellRecordRead(first_key)
|
||||
defer { PackageFree(tombstone) }
|
||||
check_true("retry and replay preserve delivery tombstones", tombstone == "{\"delivered\":true}")
|
||||
check_true("remaining recovered report can complete", FeedbackDelivered(second_id))
|
||||
|
||||
saved_owner: [64]u8
|
||||
unused AppCopyText(AppTextFromCString(storage_user_id_buffer(), 64), saved_owner[:])
|
||||
unused AppCopyText("legacy-other-account", g_storage.user_id[:])
|
||||
foreign_out: Vec(u8)
|
||||
BuilderPrint(*foreign_out, "[")
|
||||
LegacyReport(*foreign_out, foreign_id, "Other account's report", "Keep this account scoped", "")
|
||||
BuilderPrint(*foreign_out, "]")
|
||||
foreign := BuilderFinish(foreign_out)
|
||||
defer { PackageFree(foreign) }
|
||||
storage_set_setting_text("lumi_feedback_pending", foreign)
|
||||
unused AppCopyText(TextUntilNul(saved_owner[:]), g_storage.user_id[:])
|
||||
check_true("upgrade does not read another account's legacy queue", !Pending())
|
||||
unused AppCopyText("legacy-other-account", g_storage.user_id[:])
|
||||
check_true("other account recovers only its own older report", Pending())
|
||||
check_true("other account's recovered report completes", FeedbackDelivered(foreign_id))
|
||||
unused AppCopyText(TextUntilNul(saved_owner[:]), g_storage.user_id[:])
|
||||
check_true("accounts remain isolated after upgrading", !Pending())
|
||||
damaged := "[{\"id\":\"incomplete\"}]"
|
||||
storage_set_setting_text("lumi_feedback_pending", damaged)
|
||||
check_true("invalid older records are not queued", !Pending())
|
||||
check_true("invalid older data is retained for recovery",
|
||||
storage_setting_text_equals("lumi_feedback_pending", damaged) != 0)
|
||||
}
|
||||
|
||||
#program_export
|
||||
Check :: () -> s32 {
|
||||
transport := FeedbackTestTransport()
|
||||
check_true("fixture transport available", transport.start != null)
|
||||
guard := support_begin("/tmp/inbe-lumi-feedback-test/")
|
||||
if guard != 0 {
|
||||
return guard
|
||||
}
|
||||
english_catalog = "[lumi_feedback_delivered]\nThe developer inbox received your feedback.\n---\n[lumi_feedback_unavailable]\nDelivery to the developer inbox is not confirmed. Your feedback is saved on this device and will retry.\n---\n"
|
||||
install_english_catalog()
|
||||
root := "/tmp/inbe-lumi-feedback-test/data"
|
||||
check_true("fixture database initialized", storage_init(root) != 0)
|
||||
check_true("owner created", CreateSyncAccount(*owner) != 0)
|
||||
check_true("owner saved", sync_account_save(*owner,
|
||||
cast(SyncAccountLocalDataChoice)SyncAccountLocalDataChoice.SYNC_ACCOUNT_LOCAL_DATA_MERGE) ==
|
||||
cast(SyncAccountSaveResult)SyncAccountSaveResult.SYNC_ACCOUNT_SAVE_OK)
|
||||
draft := FeedbackDraft("Lumi freezes", "Please fix Lumi freezing", "view=lumi")
|
||||
defer { PackageFree(draft) }
|
||||
app: InnerBreeze
|
||||
Attempt(*app)
|
||||
check_int("draft never submits before approval", submissions, 0)
|
||||
check_true("draft is not in approved outbox", !Pending())
|
||||
check_true("Yes queues report", FeedbackChoice(draft, 1))
|
||||
check_true("duplicate Yes stays rejected", !FeedbackChoice(draft, 1))
|
||||
report_id := PackageText(draft, draft)
|
||||
defer { PackageFree(report_id) }
|
||||
|
||||
Attempt(*app)
|
||||
check_true("HTTP failure retains report", Pending())
|
||||
check_true("HTTP failure is visible", LumiStoreCount() == 1 &&
|
||||
contains(LumiStoreRow(0).text, "is not confirmed"))
|
||||
Attempt(*app)
|
||||
check_int("repeat failure does not flood history", LumiStoreCount(), 1)
|
||||
|
||||
LumiOnlineCancel()
|
||||
LumiStoreReset()
|
||||
storage_close()
|
||||
check_true("database reopens", storage_init(root) != 0)
|
||||
check_true("approved report survives restart", Pending())
|
||||
Attempt(*app)
|
||||
check_int("failure notice survives restart without duplication", LumiStoreCount(), 1)
|
||||
|
||||
feedback_status = 200
|
||||
feedback_response = "true"
|
||||
Attempt(*app)
|
||||
check_true("unrelated HTTP success never loses report", Pending())
|
||||
feedback_response = "\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\""
|
||||
Attempt(*app)
|
||||
check_true("another report's receipt never loses report", Pending())
|
||||
receipt: Vec(u8)
|
||||
LumiJsonString(*receipt, report_id)
|
||||
correct := BuilderFinish(receipt)
|
||||
defer { PackageFree(correct) }
|
||||
feedback_response = PackageText(correct, "garbage")
|
||||
Attempt(*app)
|
||||
check_true("trailing receipt data never loses report", Pending())
|
||||
PackageFree(feedback_response)
|
||||
feedback_response = correct
|
||||
start_fails = true
|
||||
Attempt(*app)
|
||||
check_true("transport start failure retains report", Pending())
|
||||
check_int("transport errors do not flood history", LumiStoreCount(), 1)
|
||||
start_fails = false
|
||||
feedback_response = PackageText(correct, " \r\n\t")
|
||||
Attempt(*app)
|
||||
check_true("matching receipt completes delivery", !Pending())
|
||||
check_int("matching receipt adds confirmation", LumiStoreCount(), 2)
|
||||
check_true("confirmation names the report", contains(LumiStoreRow(1).text,
|
||||
"developer inbox received") && contains(LumiStoreRow(1).text, "Lumi freezes"))
|
||||
PackageFree(feedback_response)
|
||||
Attempt(*app)
|
||||
check_int("completed delivery never repeats confirmation", LumiStoreCount(), 2)
|
||||
LumiOnlineCancel()
|
||||
LumiStoreReset()
|
||||
storage_close()
|
||||
check_true("confirmed database reopens", storage_init(root) != 0)
|
||||
check_true("completion survives restart", !Pending())
|
||||
check_int("delivery history persists", LumiStoreCount(), 2)
|
||||
switch_report = FeedbackEnqueue("Account switch", "Keep each account's report private", "")
|
||||
defer { PackageFree(switch_report) }
|
||||
receipt = .{}
|
||||
LumiJsonString(*receipt, switch_report)
|
||||
feedback_response = BuilderFinish(receipt)
|
||||
defer { PackageFree(feedback_response) }
|
||||
saved_owner: [64]u8
|
||||
unused AppCopyText(AppTextFromCString(storage_user_id_buffer(), 64), saved_owner[:])
|
||||
switch_in_poll = true
|
||||
Attempt(*app)
|
||||
check_true("new account's pending report is preserved", Pending())
|
||||
check_int("old account's notice never enters new history", LumiStoreCount(), 0)
|
||||
unused AppCopyText(TextUntilNul(saved_owner[:]), g_storage.user_id[:])
|
||||
check_true("original account's report is preserved", Pending())
|
||||
check_int("canceled receipt adds no false notice", LumiStoreCount(), 2)
|
||||
Attempt(*app)
|
||||
check_true("original account can still confirm its report", !Pending())
|
||||
check_int("separate report receives its own confirmation", LumiStoreCount(), 3)
|
||||
LumiOnlineCancel()
|
||||
LegacyOutboxChecks(root, report_id)
|
||||
SyncCryptoWipe(*owner.private_key_hex[0], SYNC_PRIVATE_KEY_HEX_SIZE)
|
||||
storage_close()
|
||||
remove_tree("/tmp/inbe-lumi-feedback-test/")
|
||||
return failures
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
compiler=${1:-"$root/build/ziran-toolchain/bin/ziran"}
|
||||
liboqs=${2:-"$root/vendor-builds/linux/x86_64/inbe-liboqs/lib/liboqs.a"}
|
||||
work="$root/build/lumi-feedback-test"
|
||||
exec 9>"$work.lock"
|
||||
flock 9
|
||||
unset DISPLAY WAYLAND_DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS
|
||||
export YUE_DESKTOP_RECOVERY=0
|
||||
mkdir -p "$work/generated"
|
||||
"$compiler" build --target=c --define PLATFORM_DESKTOP --root "$root/tests" \
|
||||
--module-path "$root/src" --module-path "$root/build/packages/kryon/src/ui" \
|
||||
--module-path "$root/build/packages/kss/src" --module-path "oqs=$root/build/packages/oqs/src" \
|
||||
--module-path "kryon=$root/build/packages/kryon/src/ui" \
|
||||
--module-path "$root/build/packages/kryon/src/backend" \
|
||||
--module-path "$root/build/packages/game2d/src" \
|
||||
--module-path "$root/build/packages/ziran/std" \
|
||||
--module-path "$root/build/packages/daochi-client" \
|
||||
--entry lumi_feedback_delivery_behavior:Check -o "$work/generated" \
|
||||
"$root/tests/lumi_feedback_delivery_behavior.zi" "$root/tests/sync_test_host.zi"
|
||||
# Calls within one translation unit cannot be intercepted by the linker's
|
||||
# --wrap. Isolate the unused conversation branches in this generated fixture;
|
||||
# either branch aborts if the feedback pump unexpectedly invokes it.
|
||||
python3 - "$work/generated/lumi_online.c" <<'PY'
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
path = Path(sys.argv[1])
|
||||
source = path.read_text()
|
||||
for name in ("LumiOnlineAnswer", "LumiOnlineRequest"):
|
||||
source = source.replace(f"lumi_online_{name}(app)", f"__wrap_lumi_online_{name}(app)")
|
||||
source = source.replace('#include "lumi_online.h"', '#include "lumi_online.h"\n'
|
||||
'extern bool __wrap_lumi_online_LumiOnlineAnswer(InnerBreeze *app);\n'
|
||||
'extern bool __wrap_lumi_online_LumiOnlineRequest(InnerBreeze *app);')
|
||||
path.write_text(source)
|
||||
PY
|
||||
cat > "$work/generated/main.c" <<'C'
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "lumi_feedback_delivery_behavior.h"
|
||||
#include "network_transport.h"
|
||||
#include "lumi_online.h"
|
||||
#include "lumi_telegram.h"
|
||||
#include "app_nav_state.h"
|
||||
#include "practice_actions.h"
|
||||
|
||||
AsyncTransport __wrap_network_transport_NetworkTransport(NetworkTransfer *transfer)
|
||||
{
|
||||
(void)transfer;
|
||||
return FeedbackTestTransport();
|
||||
}
|
||||
void __wrap_lumi_telegram_LumiTelegramPump(InnerBreeze *app)
|
||||
{
|
||||
(void)app;
|
||||
}
|
||||
bool __wrap_lumi_online_LumiOnlineAnswer(InnerBreeze *app)
|
||||
{
|
||||
(void)app;
|
||||
fputs("unexpected online conversation in feedback fixture\n", stderr);
|
||||
abort();
|
||||
}
|
||||
bool __wrap_lumi_online_LumiOnlineRequest(InnerBreeze *app)
|
||||
{
|
||||
(void)app;
|
||||
fputs("unexpected online request in feedback fixture\n", stderr);
|
||||
abort();
|
||||
}
|
||||
void __wrap_app_apply_nav_route(InnerBreeze *app, int32_t route)
|
||||
{
|
||||
(void)app;
|
||||
(void)route;
|
||||
abort();
|
||||
}
|
||||
bool __wrap_practice_actions_app_start_practice(InnerBreeze *app, int32_t practice)
|
||||
{
|
||||
(void)app;
|
||||
(void)practice;
|
||||
abort();
|
||||
}
|
||||
int main(void)
|
||||
{
|
||||
int result = Check();
|
||||
return result == 0 ? 0 : 1;
|
||||
}
|
||||
C
|
||||
monocypher="$root/build/packages/monocypher/src"
|
||||
"${CC:-cc}" -std=c11 -O0 -ffunction-sections -fdata-sections \
|
||||
-I"$root/build/packages/ziran/include" -I"$work/generated" \
|
||||
-I"$root/vendor-builds/sqlite" -I"$root/vendor-builds/linux/x86_64/inbe-liboqs/include" \
|
||||
-I"$monocypher" -I"$monocypher/optional" \
|
||||
"$work/generated"/*.c "$root/vendor-builds/sqlite/sqlite3.c" \
|
||||
"$monocypher/monocypher.c" "$monocypher/optional/monocypher-ed25519.c" \
|
||||
"$liboqs" -Wl,--gc-sections -Wl,--wrap=network_transport_NetworkTransport \
|
||||
-Wl,--wrap=lumi_telegram_LumiTelegramPump -Wl,--wrap=lumi_online_LumiOnlineAnswer \
|
||||
-Wl,--wrap=app_apply_nav_route -Wl,--wrap=practice_actions_app_start_practice \
|
||||
-ldl -lpthread -lz -lm -o "$work/test"
|
||||
APP_DATA_ROOT=/tmp/inbe-lumi-feedback-test/data "$work/test"
|
||||
printf '%s\n' 'Lumi feedback approval, HTTP failure, receipt verification, retries, restart and older outbox upgrade checks passed'
|
||||
@@ -13,5 +13,21 @@ Answer :: () -> s32 {
|
||||
LumiResponseMessageAt("{}\n") >= 0 {
|
||||
return 2
|
||||
}
|
||||
id := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
receipt := "\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\""
|
||||
if !LumiFeedbackReceiptMatches(receipt, id) ||
|
||||
!LumiFeedbackReceiptMatches(" \n\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" \r\n\t", id) {
|
||||
return 3
|
||||
}
|
||||
invalid: [8]string = .["true", "{}", "\"short\"", "null", "\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"garbage",
|
||||
"\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"", "\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ""]
|
||||
for value: invalid {
|
||||
if LumiFeedbackReceiptMatches(value, id) {
|
||||
return 4
|
||||
}
|
||||
}
|
||||
if LumiFeedbackReceiptMatches(receipt, "short") {
|
||||
return 5
|
||||
}
|
||||
return 42
|
||||
}
|
||||
@@ -30,6 +30,15 @@ PRACTICES = {"whm": 1, "meditation": 2, "sun_salutation": 3, "patterns": 4}
|
||||
# corner 16 units in from the bottom right.
|
||||
WINDOW = (162, 72, 220, 320)
|
||||
MINIMIZE = (308, 38)
|
||||
# With advanced session controls, Next is the last of three 44-unit buttons
|
||||
# 12 units apart, centered along the bottom of the 720-unit page.
|
||||
NEXT = (251, 692)
|
||||
# The held breath's Breath button on the practice's screen, and in the
|
||||
# window, where it is centered along the bottom of the picture, 36 units
|
||||
# tall and ending 54 units above the window's bottom. Each box stays inside
|
||||
# the light button so its label keeps its contrast.
|
||||
SCREEN_BREATH = (95, 475, 200, 60)
|
||||
WINDOW_BREATH = (WINDOW[0] + 60, WINDOW[1] + WINDOW[3] - 92, WINDOW[2] - 120, 40)
|
||||
|
||||
|
||||
def window_parts(left, top, width, height):
|
||||
@@ -111,6 +120,17 @@ with tempfile.TemporaryDirectory(prefix="inbe-session-window-") as directory, co
|
||||
(OUTPUT / (label + ".txt")).write_text("\n".join(f"{w} {l:.0f},{t:.0f}" for w, l, t, *_ in found))
|
||||
return found
|
||||
|
||||
def label_in(window, label, box):
|
||||
"""The words in a small box, read on their own so a light button keeps its contrast."""
|
||||
left, top, width, height = box
|
||||
path = capture(window, label)
|
||||
large = OUTPUT / (label + "-box.png")
|
||||
command("convert", str(path), "-crop", f"{width}x{height}+{left}+{top}", "+repage",
|
||||
"-colorspace", "gray", "-resize", "400%", "-normalize", str(large))
|
||||
text = command("tesseract", str(large), "stdout", "--psm", "7")
|
||||
(OUTPUT / (label + ".txt")).write_text(text)
|
||||
return text.upper().split()
|
||||
|
||||
def line_middle(window, label, text):
|
||||
"""The center of the text line holding the word, from its first word to its last."""
|
||||
found = words(window, label)
|
||||
@@ -122,9 +142,10 @@ with tempfile.TemporaryDirectory(prefix="inbe-session-window-") as directory, co
|
||||
right = max(item[1] + item[3] for item in row)
|
||||
return (left + right) / 2, anchor[2] + anchor[4] / 2
|
||||
|
||||
def find(window, label, text, region=lambda x, y: True):
|
||||
def find(window, label, text, region=lambda x, y: True, whole=False):
|
||||
for word, left, top, width, height in words(window, label):
|
||||
if text.lower() in word.lower() and region(left, top):
|
||||
found = text.lower() == word.lower() if whole else text.lower() in word.lower()
|
||||
if found and region(left, top):
|
||||
return left + width / 2, top + height / 2, left, top
|
||||
return None
|
||||
|
||||
@@ -163,6 +184,14 @@ with tempfile.TemporaryDirectory(prefix="inbe-session-window-") as directory, co
|
||||
command("xdotool", "mouseup", "1")
|
||||
time.sleep(.6)
|
||||
|
||||
def double_tap(window, x, y):
|
||||
# Each press lasts a few frames; both land well within the double
|
||||
# tap's 0.35 seconds.
|
||||
command("xdotool", "mousemove", "--window", window, str(int(x)), str(int(y)),
|
||||
"mousedown", "1", "sleep", "0.05", "mouseup", "1", "sleep", "0.08",
|
||||
"mousedown", "1", "sleep", "0.05", "mouseup", "1")
|
||||
time.sleep(.6)
|
||||
|
||||
def swipe(window, start, end):
|
||||
# Hold the press for a frame first, so the app sees it where it starts.
|
||||
args = ["xdotool", "mousemove", "--window", window, str(int(start[0])), str(int(start[1])),
|
||||
@@ -192,20 +221,23 @@ with tempfile.TemporaryDirectory(prefix="inbe-session-window-") as directory, co
|
||||
def wait_running(window, why):
|
||||
assert state(window)["practice_running"], (why, state(window))
|
||||
|
||||
def save_settings(values):
|
||||
with sqlite3.connect(profile / "inbe.db") as db:
|
||||
user = db.execute("SELECT id FROM users LIMIT 1").fetchone()[0]
|
||||
for key, value in values.items():
|
||||
db.execute("INSERT INTO settings(user_id,key,value,updated_at) VALUES(?,?,?,1) "
|
||||
"ON CONFLICT(user_id,key) DO UPDATE SET value=excluded.value", (user, key, value))
|
||||
|
||||
with application("initialize", 390, 720):
|
||||
pass
|
||||
with sqlite3.connect(profile / "inbe.db") as db:
|
||||
user = db.execute("SELECT id FROM users LIMIT 1").fetchone()[0]
|
||||
# Lumi is pinned first: a practice must still minimize to the page it
|
||||
# was started from, not to the first pinned app.
|
||||
values = dict(enabled_apps="31", main_tab="1", language="en", language_setup_done="1",
|
||||
apps_setup_done="1", launcher_guide_seen="1", lumi_introduced="1", tutorial_seen="1",
|
||||
cells_auto_update="0", habits_guide_seen="1", launcher_favorite_count="3",
|
||||
launcher_favorite_0="12", launcher_favorite_1="1", launcher_favorite_2="2")
|
||||
values.update({"app_used_" + name: "1" for name in ("lumi", "habits", "lists", "diary", "practices")})
|
||||
for key, value in values.items():
|
||||
db.execute("INSERT INTO settings(user_id,key,value,updated_at) VALUES(?,?,?,1) "
|
||||
"ON CONFLICT(user_id,key) DO UPDATE SET value=excluded.value", (user, key, value))
|
||||
# Lumi is pinned first: a practice must still minimize to the page it
|
||||
# was started from, not to the first pinned app.
|
||||
values = dict(enabled_apps="31", main_tab="1", language="en", language_setup_done="1",
|
||||
apps_setup_done="1", launcher_guide_seen="1", lumi_introduced="1", tutorial_seen="1",
|
||||
cells_auto_update="0", habits_guide_seen="1", launcher_favorite_count="3",
|
||||
launcher_favorite_0="12", launcher_favorite_1="1", launcher_favorite_2="2")
|
||||
values.update({"app_used_" + name: "1" for name in ("lumi", "habits", "lists", "diary", "practices")})
|
||||
save_settings(values)
|
||||
|
||||
# Every practice minimizes to Practice, where it was started, and keeps
|
||||
# its live picture moving in the window until maximize returns to it.
|
||||
@@ -372,6 +404,55 @@ with tempfile.TemporaryDirectory(prefix="inbe-session-window-") as directory, co
|
||||
assert state(window)["screen"] == SCREEN_HABITS, ("Ending left the open app", state(window))
|
||||
assert not find(window, "after-exit", "ROUND"), "The window stayed after the practice ended"
|
||||
|
||||
# A held breath ends right from the window, the way the practice is set
|
||||
# to end it: with its Breath button, or with a double tap. A single tap
|
||||
# set to double tap stays on the open page.
|
||||
for double_tap_mode in (() if DESKTOP_ONLY else (False, True)):
|
||||
mode = "double-tap" if double_tap_mode else "button"
|
||||
save_settings(dict(advanced_session_controls="1",
|
||||
double_tap_to_breathe="1" if double_tap_mode else "0"))
|
||||
|
||||
def holding(window, label):
|
||||
"""The practice's screen shows the held breath's Breath button or double tap hint."""
|
||||
if double_tap_mode:
|
||||
return find(window, label, "Double", lambda x, y: y > 360, True) is not None
|
||||
return "BREATH" in label_in(window, label, SCREEN_BREATH)
|
||||
|
||||
with application("breathe-" + mode, 390, 720) as window:
|
||||
action(window, "mcp.open_view", "open-habits-" + mode, {"view": "habits"})
|
||||
wait_screen(window, SCREEN_HABITS, "Habits did not open to breathe from the window")
|
||||
action(window, "practice.whm.start", "start-whm-" + mode)
|
||||
wait_screen(window, SCREEN_SESSION, "Breathing did not start to breathe from the window")
|
||||
# Next skips the countdown and the breaths to the held breath.
|
||||
for step in range(4):
|
||||
if holding(window, f"breathe-{mode}-hold-{step}"):
|
||||
break
|
||||
click(window, *NEXT)
|
||||
else:
|
||||
assert False, "Next did not reach the held breath"
|
||||
click(window, *MINIMIZE)
|
||||
wait_screen(window, SCREEN_HABITS, "Minimize did not return to Habits during the held breath")
|
||||
wait_running(window, "Minimizing ended the held breath")
|
||||
offered = "BREATH" in label_in(window, f"breathe-{mode}-window", WINDOW_BREATH)
|
||||
middle = (parts["picture"][0] + parts["picture"][2] / 2, parts["picture"][1] + 60)
|
||||
if double_tap_mode:
|
||||
assert not offered, "The window shows Breath while set to double tap"
|
||||
click(window, *middle)
|
||||
assert state(window)["screen"] == SCREEN_HABITS, "A single tap left the open page"
|
||||
double_tap(window, *middle)
|
||||
else:
|
||||
assert offered, "The window does not offer Breath during the held breath"
|
||||
click(window, WINDOW_BREATH[0] + WINDOW_BREATH[2] / 2, WINDOW_BREATH[1] + WINDOW_BREATH[3] / 2)
|
||||
assert "BREATH" not in label_in(window, f"breathe-{mode}-done", WINDOW_BREATH), \
|
||||
"Breath stayed in the window after breathing"
|
||||
assert state(window)["screen"] == SCREEN_HABITS, "Breathing from the window left the open page"
|
||||
wait_running(window, "Breathing from the window ended the practice")
|
||||
click(window, *parts["maximize"])
|
||||
wait_screen(window, SCREEN_SESSION, "Maximize did not return after breathing from the window")
|
||||
assert not holding(window, f"breathe-{mode}-recovery"), \
|
||||
"The practice is still holding the breath after breathing from the window"
|
||||
save_settings(dict(advanced_session_controls="0", double_tap_to_breathe="0"))
|
||||
|
||||
rail = lambda x, y: x < 100
|
||||
with application("desktop", 900, 720) as window:
|
||||
action(window, "mcp.open_view", "open-habits-desktop", {"view": "habits"})
|
||||
|
||||
@@ -71,7 +71,6 @@ host_unload_file_data :: (data: *u8) {
|
||||
|
||||
// Directory listing for legacy text sessions, as raylib's FilePathList.
|
||||
PathList :: struct {
|
||||
capacity: u32
|
||||
count: u32
|
||||
paths: **u8
|
||||
}
|
||||
@@ -90,7 +89,7 @@ pipe_mode: [2]u8;
|
||||
host_load_directory_files :: (root: *u8, filter: *u8, recursive: bool) -> PathList {
|
||||
unused filter
|
||||
unused recursive
|
||||
list: PathList = PathList.{0, 0, null}
|
||||
list: PathList = PathList.{0, null}
|
||||
if root == null { return list }
|
||||
prefix: string = "find \""
|
||||
index: s64 = 0
|
||||
@@ -122,7 +121,6 @@ host_load_directory_files :: (root: *u8, filter: *u8, recursive: bool) -> PathLi
|
||||
HostPipeClose(pipe)
|
||||
return list
|
||||
}
|
||||
list.capacity = cast(u32)capacity
|
||||
while HostLine(*line_bytes[0], 1100, pipe) != null && cast(usize)list.count < capacity {
|
||||
length: s32 = 0
|
||||
while line_bytes[length] != cast(u8)0 && line_bytes[length] != cast(u8)10 { length += 1 }
|
||||
|
||||
+4
-4
@@ -6,8 +6,8 @@ IDI_APP_ICON ICON "inbe.ico"
|
||||
IDI_NOTIFICATION_ICON ICON "inbe.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,1,26,0
|
||||
PRODUCTVERSION 2,1,26,0
|
||||
FILEVERSION 2,1,27,0
|
||||
PRODUCTVERSION 2,1,27,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -24,11 +24,11 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "waozi"
|
||||
VALUE "FileDescription", "Inner Breeze"
|
||||
VALUE "FileVersion", "2.1.26"
|
||||
VALUE "FileVersion", "2.1.27"
|
||||
VALUE "InternalName", "inbe"
|
||||
VALUE "OriginalFilename", "inbe-windows-x86_64.exe"
|
||||
VALUE "ProductName", "Inner Breeze"
|
||||
VALUE "ProductVersion", "2.1.26"
|
||||
VALUE "ProductVersion", "2.1.27"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
+11
-11
@@ -3,7 +3,7 @@
|
||||
"packages": [
|
||||
{
|
||||
"commit": "f01be2f1d5acf2a570e351013221238b7c543760",
|
||||
"dependencies": {"kryon": "p62f4c9f67f0c5994"},
|
||||
"dependencies": {"kryon": "pef7798a196435ade"},
|
||||
"id": "p03de317562242e4f",
|
||||
"name": "Kss",
|
||||
"ref": "master",
|
||||
@@ -62,14 +62,6 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/raysan5/raylib.git"
|
||||
},
|
||||
{
|
||||
"commit": "a3fedeb22f4182a01bfd4b5e66281e4609ed69de",
|
||||
"dependencies": {"raylib": "p5a77c9c35110e925"},
|
||||
"id": "p62f4c9f67f0c5994",
|
||||
"name": "kryon",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
},
|
||||
{
|
||||
"commit": "5da6fd4944822ec8f2aeb7426ac58c94f005ab35",
|
||||
"dependencies": {"oqs": "p55635fc8976895a9"},
|
||||
@@ -80,7 +72,7 @@
|
||||
},
|
||||
{
|
||||
"commit": "7aa01465ac3f988e0404f3c6dc244bf4b009f253",
|
||||
"dependencies": {"kryon": "p62f4c9f67f0c5994"},
|
||||
"dependencies": {"kryon": "pef7798a196435ade"},
|
||||
"id": "paa08e1730a25bda0",
|
||||
"name": "Game2D",
|
||||
"ref": "master",
|
||||
@@ -94,10 +86,18 @@
|
||||
"ref": "master",
|
||||
"source": true,
|
||||
"url": "https://github.com/curl/curl.git"
|
||||
},
|
||||
{
|
||||
"commit": "a5a233b1245c577a5a466df9f4c6f544abf71a62",
|
||||
"dependencies": {"raylib": "p5a77c9c35110e925"},
|
||||
"id": "pef7798a196435ade",
|
||||
"name": "kryon",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
}
|
||||
],
|
||||
"root": {
|
||||
"dependencies": {"curl": "pc4b263336680098b", "daochi_client": "pa6cfb65dcd8a925b", "game2d": "paa08e1730a25bda0", "kryon": "p62f4c9f67f0c5994", "kss": "p03de317562242e4f", "liboqs": "p0d047aae8cb8cecb", "monocypher": "p2ff634c7b007140d", "oqs": "p55635fc8976895a9", "rini": "p09fa77e94b0dfc6c", "sqlite": "p151b83a361c86f2d"},
|
||||
"dependencies": {"curl": "pc4b263336680098b", "daochi_client": "pa6cfb65dcd8a925b", "game2d": "paa08e1730a25bda0", "kryon": "pef7798a196435ade", "kss": "p03de317562242e4f", "liboqs": "p0d047aae8cb8cecb", "monocypher": "p2ff634c7b007140d", "oqs": "p55635fc8976895a9", "rini": "p09fa77e94b0dfc6c", "sqlite": "p151b83a361c86f2d"},
|
||||
"name": "Inbe"
|
||||
},
|
||||
"toolchain": {
|
||||
|
||||
Reference in new issue
Block a user