altv-issues
altv-issues copied to clipboard
Meta change event is called for unchanged data
Description of the problem
When you call any function to set any type of metadata with the same data, it will be set twice.
Reproduction steps
import alt from 'alt-server'
alt.on('globalMetaChange', (...args) => {
alt.log('globalMetaChange', args)
})
alt.on('globalSyncedMetaChange', (...args) => {
alt.log('globalSyncedMetaChange', args)
})
alt.setMeta('example', 123)
alt.setMeta('example', 123)
alt.setMeta('example', 123)
alt.setSyncedMeta('example', 123)
alt.setSyncedMeta('example', 123)
alt.setSyncedMeta('example', 123)

Expected behaviour
If the data is equal to data already set for this meta key, it should not be set twice.
Additional context
No response
Operating system
Windows 11
Version
15.0-dev3
Reproduction tested
- [ ] I confirm that I have made sure that this issue is also present on the newest dev version