diff --git a/lib/types/sqlite-types.js b/lib/types/sqlite-types.js --- a/lib/types/sqlite-types.js +++ b/lib/types/sqlite-types.js @@ -35,6 +35,7 @@ +plaintext: string, +ciphertext: string, +status: OutboundP2PMessageStatuses, + +supportsAutoRetry: boolean, }; export type SQLiteAPI = { diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp --- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp +++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp @@ -2302,8 +2302,8 @@ static std::string addMessage = "REPLACE INTO outbound_p2p_messages (" " message_id, device_id, user_id, timestamp," - " plaintext, ciphertext, status) " - "VALUES (?, ?, ?, ?, ?, ?, ?);"; + " plaintext, ciphertext, status, supports_auto_retry) " + "VALUES (?, ?, ?, ?, ?, ?, ?, ?);"; for (const OutboundP2PMessage &clientMessage : messages) { SQLiteOutboundP2PMessage message = diff --git a/native/cpp/CommonCpp/DatabaseManagers/entities/OutboundP2PMessage.h b/native/cpp/CommonCpp/DatabaseManagers/entities/OutboundP2PMessage.h --- a/native/cpp/CommonCpp/DatabaseManagers/entities/OutboundP2PMessage.h +++ b/native/cpp/CommonCpp/DatabaseManagers/entities/OutboundP2PMessage.h @@ -16,6 +16,7 @@ std::string plaintext; std::string ciphertext; std::string status; + int supports_auto_retry; static SQLiteOutboundP2PMessage fromSQLResult(sqlite3_stmt *sqlRow, int idx) { return SQLiteOutboundP2PMessage{ @@ -26,6 +27,7 @@ getStringFromSQLRow(sqlRow, idx + 4), getStringFromSQLRow(sqlRow, idx + 5), getStringFromSQLRow(sqlRow, idx + 6), + getIntFromSQLRow(sqlRow, idx + 7), }; } @@ -36,7 +38,8 @@ bindInt64ToSQL(timestamp, sql, idx + 3); bindStringToSQL(plaintext, sql, idx + 4); bindStringToSQL(ciphertext, sql, idx + 5); - return bindStringToSQL(status, sql, idx + 6); + bindStringToSQL(status, sql, idx + 6); + return bindIntToSQL(supports_auto_retry, sql, idx + 7); } }; @@ -48,6 +51,7 @@ std::string plaintext; std::string ciphertext; std::string status; + bool supports_auto_retry; OutboundP2PMessage() = default; @@ -58,14 +62,16 @@ const std::string ×tamp, const std::string &plaintext, const std::string &ciphertext, - const std::string &status) + const std::string &status, + const bool &supports_auto_retry) : message_id(message_id), device_id(device_id), user_id(user_id), timestamp(timestamp), plaintext(plaintext), ciphertext(ciphertext), - status(status) { + status(status), + supports_auto_retry(supports_auto_retry) { } OutboundP2PMessage(const SQLiteOutboundP2PMessage &msg) { @@ -76,6 +82,7 @@ plaintext = msg.plaintext; ciphertext = msg.ciphertext; status = msg.status; + supports_auto_retry = msg.supports_auto_retry == 1; } SQLiteOutboundP2PMessage toSQLiteOutboundP2PMessage() const { @@ -87,6 +94,7 @@ msg.plaintext = plaintext; msg.ciphertext = ciphertext; msg.status = status; + msg.supports_auto_retry = supports_auto_retry; return msg; } }; diff --git a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp --- a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp +++ b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp @@ -476,6 +476,8 @@ msgObj.getProperty(rt, "ciphertext").asString(rt).utf8(rt); std::string status = msgObj.getProperty(rt, "status").asString(rt).utf8(rt); + bool supports_auto_retry = + msgObj.getProperty(rt, "supportsAutoRetry").asBool(); OutboundP2PMessage outboundMessage{ messageID, @@ -484,7 +486,8 @@ timestamp, plaintext, ciphertext, - status}; + status, + supports_auto_retry}; messages.push_back(outboundMessage); } } @@ -2453,6 +2456,8 @@ jsiMsg.setProperty(innerRt, "plaintext", msg.plaintext); jsiMsg.setProperty(innerRt, "ciphertext", msg.ciphertext); jsiMsg.setProperty(innerRt, "status", msg.status); + jsiMsg.setProperty( + innerRt, "supportsAutoRetry", msg.supports_auto_retry); jsiMessages.setValueAtIndex(innerRt, writeIdx++, jsiMsg); } diff --git a/web/cpp/SQLiteQueryExecutorBindings.cpp b/web/cpp/SQLiteQueryExecutorBindings.cpp --- a/web/cpp/SQLiteQueryExecutorBindings.cpp +++ b/web/cpp/SQLiteQueryExecutorBindings.cpp @@ -128,7 +128,8 @@ .field("timestamp", &OutboundP2PMessage::timestamp) .field("plaintext", &OutboundP2PMessage::plaintext) .field("ciphertext", &OutboundP2PMessage::ciphertext) - .field("status", &OutboundP2PMessage::status); + .field("status", &OutboundP2PMessage::status) + .field("supportsAutoRetry", &OutboundP2PMessage::supports_auto_retry); value_object("InboundP2PMessage") .field("messageID", &InboundP2PMessage::message_id) diff --git a/web/shared-worker/_generated/comm-query-executor.js b/web/shared-worker/_generated/comm-query-executor.js --- a/web/shared-worker/_generated/comm-query-executor.js +++ b/web/shared-worker/_generated/comm-query-executor.js @@ -116,7 +116,7 @@ V.prototype.xd=function(a){this.Tc&&(a=this.Tc(a));return a};V.prototype.Hc=function(a){this.pb&&this.pb(a)};V.prototype.argPackAdvance=8;V.prototype.readValueFromPointer=lb;V.prototype.deleteObject=function(a){if(null!==a)a["delete"]()}; V.prototype.fromWireType=function(a){function b(){return this.Vb?Jb(this.Ta.Eb,{Xa:this.Md,Sa:c,fb:this,ab:a}):Jb(this.Ta.Eb,{Xa:this,Sa:a})}var c=this.xd(a);if(!c)return this.Hc(a),null;var d=Ib(this.Ta,c);if(void 0!==d){if(0===d.Na.count.value)return d.Na.Sa=c,d.Na.ab=a,d.clone();d=d.clone();this.Hc(a);return d}d=this.Ta.vd(c);d=Db[d];if(!d)return b.call(this);d=this.Tb?d.jd:d.pointerType;var f=Cb(c,this.Ta,d.Ta);return null===f?b.call(this):this.Vb?Jb(d.Ta.Eb,{Xa:d,Sa:f,fb:this,ab:a}):Jb(d.Ta.Eb, {Xa:d,Sa:f})};Wb=e.UnboundTypeError=rb("UnboundTypeError");e.count_emval_handles=function(){for(var a=0,b=5;bf?-28:N.Fc(d,f).fd;case 1:case 2:return 0;case 3:return d.flags;case 4:return f=hb(),d.flags|=f,0;case 5:return f=hb(),D[f+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return E[Kc()>>2]=28,-1;default:return-28}}catch(g){if("undefined"== typeof N||!(g instanceof N.Ma))throw g;return-g.Ra}},X:function(a,b){try{var c=Q(a);return fb(N.stat,c.path,b)}catch(d){if("undefined"==typeof N||!(d instanceof N.Ma))throw d;return-d.Ra}},E:function(a,b,c){try{b=c+2097152>>>0<4194305-!!b?(b>>>0)+4294967296*c:NaN;if(isNaN(b))return-61;N.ud(a,b);return 0}catch(d){if("undefined"==typeof N||!(d instanceof N.Ma))throw d;return-d.Ra}},S:function(a,b){try{if(0===b)return-28;var c=N.cwd(),d=ta(c)+1;if(b>>0,(G=h,1<=+Math.abs(G)?0>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>> @@ -135,7 +135,7 @@ h=>h;if(0===d){var k=32-8*c;g=h=>h<>>k}c=b.includes("unsigned")?function(h,n){return n>>>0}:function(h,n){return n};R(a,{name:b,fromWireType:g,toWireType:c,argPackAdvance:8,readValueFromPointer:gc(b,f,0!==d),ib:null})},g:function(a,b,c){function d(g){g>>=2;var k=F;return new f(ua,k[g+1],k[g])}var f=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];c=S(c);R(a,{name:c,fromWireType:d,argPackAdvance:8,readValueFromPointer:d},{Ad:!0})},y:function(a,b){b= S(b);var c="std::string"===b;R(a,{name:b,fromWireType:function(d){var f=F[d>>2],g=d+4;if(c)for(var k=g,h=0;h<=f;++h){var n=g+h;if(h==f||0==z[n]){k=y(k,n-k);if(void 0===q)var q=k;else q+=String.fromCharCode(0),q+=k;k=n+1}}else{q=Array(f);for(h=0;h>2]=k;if(c&&g)A(f,z,n,k+1);else if(g)for(g=0;gva;var h=1}else 4===b&&(d=lc,f=mc,g=nc,k=()=>F,h=2);R(a,{name:c,fromWireType:function(n){for(var q= -F[n>>2],p=k(),t,x=n+4,l=0;l<=q;++l){var u=n+4+l*b;if(l==q||0==p[u>>h])x=d(x,u-x),void 0===t?t=x:(t+=String.fromCharCode(0),t+=x),x=u+b}X(n);return t},toWireType:function(n,q){"string"!=typeof q&&T("Cannot pass non-string to C++ string type "+c);var p=g(q),t=wc(4+p+b);F[t>>2]=p>>h;f(q,t+4,p+b);null!==n&&n.push(X,t);return t},argPackAdvance:8,readValueFromPointer:lb,ib:function(n){X(n)}})},f:function(a,b,c,d,f,g){jb[a]={name:S(b),rc:W(c,d),pb:W(f,g),Lc:[]}},d:function(a,b,c,d,f,g,k,h,n,q){jb[a].Lc.push({rd:S(b), +F[n>>2],p=k(),t,x=n+4,l=0;l<=q;++l){var u=n+4+l*b;if(l==q||0==p[u>>h])x=d(x,u-x),void 0===t?t=x:(t+=String.fromCharCode(0),t+=x),x=u+b}X(n);return t},toWireType:function(n,q){"string"!=typeof q&&T("Cannot pass non-string to C++ string type "+c);var p=g(q),t=wc(4+p+b);F[t>>2]=p>>h;f(q,t+4,p+b);null!==n&&n.push(X,t);return t},argPackAdvance:8,readValueFromPointer:lb,ib:function(n){X(n)}})},f:function(a,b,c,d,f,g){jb[a]={name:S(b),rc:W(c,d),pb:W(f,g),Lc:[]}},c:function(a,b,c,d,f,g,k,h,n,q){jb[a].Lc.push({rd:S(b), zd:c,Sb:W(d,f),yd:g,Sd:k,Rd:W(h,n),Td:q})},ga:function(a,b){b=S(b);R(a,{Dd:!0,name:b,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},o:function(){return Date.now()},aa:function(){return!0},k:function(a,b,c){a=ec(a);b=oc(b,"emval::as");var d=[],f=Sb(d);F[c>>2]=f;return b.toWireType(d,a)},A:function(a,b,c,d){a=rc[a];b=ec(b);c=qc(c);a(b,c,null,d)},na:dc,oa:function(a,b){var c=tc(a,b),d=c[0];b=d.name+"_$"+c.slice(1).map(function(p){return p.name}).join("_")+"$";var f=uc[b];if(void 0!== f)return f;f=["retType"];for(var g=[d],k="",h=0;h>2]=a.getSeconds();E[b+4>>2]=a.getMinutes();E[b+8>>2]=a.getHours();E[b+12>>2]=a.getDate();E[b+16>>2]=a.getMonth();E[b+20>>2]=a.getFullYear()- diff --git a/web/shared-worker/_generated/comm_query_executor.wasm b/web/shared-worker/_generated/comm_query_executor.wasm index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@