Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate user id are pushed from multiple device id #61

Open
sparshrestha opened this issue Mar 19, 2024 · 0 comments
Open

duplicate user id are pushed from multiple device id #61

sparshrestha opened this issue Mar 19, 2024 · 0 comments

Comments

@sparshrestha
Copy link

Scenario:

  • 2 biometric devices are used to send different check in/ check out records to same instance of ERPNext
  • there are multiple records with same User ID in both device ID 1 & 2
  • logs folder is deleted or either one of the device is unreachable.

For example, there are 2 employees in 2 different locations/ devices with same User ID.
John Doe in Location/ Device ID 1 with User ID 29.
Sarah Doe in Location/ Device ID 2 with same User ID 29.

Now, if we add another device config to the JSON array in local_config.py with a different IP address:

devices = [
        {'device_id':'1','ip':'123.45.67.89', 'punch_direction': 'AUTO', 'clear_from_device_on_fetch': False},
        {'device_id':'2','ip':'321.54.76.98', 'punch_direction': 'AUTO', 'clear_from_device_on_fetch': False}
]

Running erpnext_sync.py will also push new record of Sarah Doe with device id 2.

Expected Behavior:
device id 1 records should have been checked against the new records of device id 2 for same User ID.
User ID should be checked against all Device ID before pushing to ERPNext.

Actual Behavior:
old records from device id 1 are pushed again to ERPNext as new records with device id 2 with same User ID.

Possible Discussion

A sample of attendance_success_log_2.log:
{"uid": 1235, "user_id": "29", "timestamp": "2023-04-12 16:30:48", "status": 2, "punch": 1}

For status: 2 is presumably device_id: 2, could we check for duplicate user_id against all status and reject those to get pushed to ERPNext.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant