Commit 1b48b0b
committed
fix(network): added early return for empty-db case: when there's no payload AND db_version == 0.
1. Added early return for empty-db case (lines 959–966): When there's no payload (blob == NULL || blob_size == 0) AND db_version == 0, skip the network call entirely and return { server_version: 0, local_version: 0, status: "synced" }. This avoids the 404 from the status endpoint when the server doesn't know the device yet.
2. Fixed condition from || to && (line 969): Changed blob != NULL || blob_size > 0 to blob != NULL && blob_size > 0 — both conditions must be true to confirm there's actual data to upload.1 parent da4387d commit 1b48b0b
1 file changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
956 | 956 | | |
957 | 957 | | |
958 | 958 | | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
959 | 969 | | |
960 | | - | |
| 970 | + | |
961 | 971 | | |
962 | 972 | | |
963 | 973 | | |
| |||
0 commit comments