nus-cs2103-AY2223S2 / forum

12 stars 0 forks source link

Feature freeze - fixing ID not resetting #314

Closed daitenshionyan closed 1 year ago

daitenshionyan commented 1 year ago

Currently for our application when the user clears the data, the ID does not reset to 1. So when the user adds another data it will continue from the last ID before the data was cleared. It was not mentioned in the UG that ID will be resetted but we feel that this is an assumed behaviour. My team an I would like to confirm if fixing this will violate feature freeze.

damithc commented 1 year ago

@daitenshionyan What happens when an item is deleted? Does the app adjusts the ID of the remaining items accordingly? e.g., If there are items 1,2,3,4 and then item 2 is deleted, does the app adjusts the remaining items to be 1,2,3? I'm trying to figure out whether not-resetting the IDs is a deliberate app-wide design decision or a bug in the implementation of the clear operation only.

daitenshionyan commented 1 year ago

@damithc The application delibrately does not adjust the remaining items. So the items will still be 1, 3 and 4 and the next will be 5 if 2 is deleted. The ID is like a serial number to identify the data instead of an index position.

daitenshionyan commented 1 year ago

I realised I did not answer the last part of the question. The IDs not resetting is both an app-wide decision and a bug in the implementation of clear (which the intended behaviour was not documented in the UG).

After typing this out I realised that it seems much more like a feature flaw rather than a bug and will not change it.

damithc commented 1 year ago

@daitenshionyan if the clear command is intended to delete away all past data without any trace, then it is a reasonable expectation that the IDs for subsequent items will start from the beginning. But I'm not sure if that is the case here, as I don't have the full context.

Scenario A:

  1. add some items (and save).
  2. run the clear command
  3. exit the app
  4. restart the app
  5. add a new item

Scenario B:

  1. add some items (and save).
  2. run the clear command
  3. add a new item

If A results in all data being wiped out and the new item starts from ID 1, but B continues from the previous ID, that means the clear command was meant to reset the ID but a bug is preventing from doing so. In that case, OK to fix the bug.

daitenshionyan commented 1 year ago

Thank you prof!! The situation is as you have described.