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

Application POST will reset created date for existing apps #361

Open
SandGrainOne opened this issue Apr 2, 2024 · 4 comments
Open

Application POST will reset created date for existing apps #361

SandGrainOne opened this issue Apr 2, 2024 · 4 comments
Labels
kind/bug Something isn't working

Comments

@SandGrainOne
Copy link
Member

Description of the bug

The POST endpoint for adding a new app now allows for existing apps. This is done with a simple conflict check in the SQL-statement. The problem with this is that the created date is defined by logic in the controller. The new value overwrites the existing date.

The logic to check for existing metadata document needs to be moved into the controller and service logic in order to prevent Storage from overwriting the created date.

Steps To Reproduce

  1. Deploy the same application twice.
  2. Notice that the created date is the timestamp of the last deploy. The same as the timestamp for last changed

Additional Information

No response

@SandGrainOne SandGrainOne added the kind/bug Something isn't working label Apr 2, 2024
@SandGrainOne
Copy link
Member Author

@nkylstad We're wondering if altinn.studio should be responsible for setting the created date time of an application. Currently we're setting the date in the Post endpoint logic. We can remove that and respect the input from altinn-studio instead.

@nkylstad
Copy link
Member

@SandGrainOne Studio sets created in applicationMetdata when creating an application. So this is already in the application object and probably doesn't have to be changed in Storage. Or are you thinking of another property?

@SandGrainOne
Copy link
Member Author

SandGrainOne commented Apr 23, 2024

@nkylstad It boils down to what we want the value to mean in practice. There was an assumption that the created date would mean first deployment time in environment. If that is still the desired meaning, altinn-studio would need to manage the value and treat it differently between first deploy and consecutive deploys.

@nkylstad
Copy link
Member

Ah I see. Well, I have no strong preferences on whether Studio should control this or Storage. If you would like Studio to set the date as part of the application-object we pass to the Post endpoint then that's fine by me! We'll create an issue and try to find some time for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants