seamapi / public-tracker

0 stars 0 forks source link

Seam cannot create two access codes with the same code for different points in time #12

Closed seveibar closed 1 year ago

seveibar commented 1 year ago

Prerequisites

Description

You cannot create two time_bound access codes that share the same

Steps to Reproduce

  1. POST /access_codes/create { device_id, code: "1234", starts_at: now(), ends_at: now() + ms("1d") }
  2. POST /access_codes/create { device_id, code: "1234", starts_at: now() + ms("1w"), ends_at: now() + ms("1w") + ms("1d") } Returns a duplicate_code error

Expected behavior: Allow the creation of both codes

Actual behavior: Errors with duplicate_code

Additional Information

itelo commented 1 year ago

So, I could think of two possible solutions:

The first solution is the easiest one, make the second access code a not native schedule.

image

In the other one, we will need to add a new variable to know if we should schedule on the device or not.

image
itelo commented 1 year ago

After discussing with Seve and Ravi, we have come to a consensus that proceeding with this feature at the moment is not ideal. This is primarily due to the numerous edge cases that this feature entails.