Skip to content

Commit

Permalink
fix test to online do retrieve metadata message
Browse files Browse the repository at this point in the history
  • Loading branch information
clairton committed Dec 10, 2024
1 parent 3f61d5b commit aec8ded
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unoapi-cloud",
"version": "1.21.15",
"version": "1.21.16",
"description": "Unoapi Cloud",
"exports": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const PROXY_URL = process.env.PROXY_URL

// behavior of unoapi
export const UNOAPI_SERVER_NAME = process.env.UNOAPI_SERVER_NAME || 'server_1'
export const CONNECTING_TIMEOUT_MS = parseInt(process.env.CONNECTING_TIMEOUT_MS || '60000')
export const CONNECTING_TIMEOUT_MS = parseInt(process.env.CONNECTING_TIMEOUT_MS || '180000')
export const UNOAPI_RETRY_REQUEST_DELAY_MS = parseInt(process.env.UNOAPI_RETRY_REQUEST_DELAY || process.env.UNOAPI_RETRY_REQUEST_DELAY_MS || '5000')
// export const QR_TIMEOUT = parseInt(process.env.QR_TIMEOUT || '30000')
// export const SLEEP_TIME = parseInt(process.env.SLEEP_TIME || '5000')
Expand Down
3 changes: 1 addition & 2 deletions src/services/client_baileys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,7 @@ export class ClientBaileys implements Client {
}

async getMessageMetadata<T>(message: T) {
const { sessionStore } = this.store!
if (!(await sessionStore.isStatusOnline(this.phone))) {
if (!this.store || !(await this.store.sessionStore.isStatusOnline(this.phone))) {
return message
}
const key = message && message['key']
Expand Down
2 changes: 1 addition & 1 deletion src/services/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export const connect = async ({
logger.info(`Connecting ${phone} set timeout to ${CONNECTING_TIMEOUT_MS} ms`)
setTimeout(async () => {
if (await sessionStore.isStatusConnecting(phone)) {
const message = `Connecting ${phone} timed out ${CONNECTING_TIMEOUT_MS}, change to disconnect`
const message = `Connecting ${phone} timed out ${CONNECTING_TIMEOUT_MS} ms, change to disconnect`
await onNotification(message, false)
logger.info(message)
await onDisconnected(phone, {})
Expand Down

0 comments on commit aec8ded

Please sign in to comment.