altv-issues icon indicating copy to clipboard operation
altv-issues copied to clipboard

Meta change event is called for unchanged data

Open xxshady opened this issue 2 years ago • 4 comments

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)

image

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

xxshady avatar Mar 25 '23 14:03 xxshady