@hiroosy/baileys-lite 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiroosy/baileys-lite",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "A Lightweight Baileys built with NodeJs 18+",
5
5
  "repository": {
6
6
  "type": "git",
@@ -61,7 +61,7 @@ export const makeChatsSocket = config => {
61
61
  const historySyncStatus = { initialBootstrapComplete: false, recentSyncComplete: false }
62
62
  let historySyncPausedTimeout
63
63
  const blockedCollections = new Set()
64
- const placeholderResendCache = config.placeholderResendCache || new Cache({ ttl: DEFAULT_CACHE_TTLS.MSG_RETRY * 1000 })
64
+ const placeholderResendCache = config.placeholderResendCache || new Cache({ max: 1024, ttl: DEFAULT_CACHE_TTLS.MSG_RETRY * 1000 })
65
65
 
66
66
  const getAppStateSyncKey = async keyId => {
67
67
  const { [keyId]: key } = await authState.keys.get('app-state-sync-key', [keyId])
@@ -100,7 +100,7 @@ export class PreKeyManager {
100
100
  }
101
101
 
102
102
  const txStorage = new AsyncLocalStorage()
103
- const SIGNAL_CACHE_BYTES = 6 * 1024 * 1024
103
+ const SIGNAL_CACHE_BYTES = 1024 * 1024
104
104
 
105
105
  export function makeCacheableSignalKeyStore(store, logger, _cache) {
106
106
 
@@ -89,7 +89,7 @@ const SIGNAL_STORE_TTL_MS = 5 * 60 * 1000
89
89
  const FLUSH_TIMEOUT_MS = 3000
90
90
 
91
91
  export const useSingleFileAuthState = async fileName => {
92
- const cache = new Cache({ max: 20000, ttl: SIGNAL_STORE_TTL_MS })
92
+ const cache = new Cache({ max: 4096, ttl: SIGNAL_STORE_TTL_MS })
93
93
  const mutex = makeKeyedMutex()
94
94
  let fileData = {}
95
95
  let isLoaded = false
@@ -483,8 +483,8 @@ const processMessage = async (message, { shouldProcessHistoryMsg, placeholderRes
483
483
 
484
484
  export default processMessage
485
485
 
486
- const RECENT_MESSAGES_SIZE = 512
487
- const RECENT_MESSAGES_BYTES = 4 * 1024 * 1024
486
+ const RECENT_MESSAGES_SIZE = 256
487
+ const RECENT_MESSAGES_BYTES = 1024 * 1024
488
488
  const MESSAGE_KEY_SEPARATOR = '\u0000'
489
489
  const RECREATE_SESSION_TIMEOUT = 60 * 60 * 1000
490
490
  const PHONE_REQUEST_DELAY = 3000