feat: persist generated coder_app id (#18487)

This commit is contained in:
Danny Kopping
2025-06-23 08:46:18 +00:00
committed by GitHub
parent 49fcffc266
commit 66e8dbbe17
9 changed files with 50 additions and 4 deletions
@@ -2595,8 +2595,19 @@ func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.
openIn = database.WorkspaceAppOpenInSlimWindow
}
var appID string
if app.Id == "" || app.Id == uuid.Nil.String() {
appID = uuid.NewString()
} else {
appID = app.Id
}
id, err := uuid.Parse(appID)
if err != nil {
return xerrors.Errorf("parse app uuid: %w", err)
}
dbApp, err := db.InsertWorkspaceApp(ctx, database.InsertWorkspaceAppParams{
ID: uuid.New(),
ID: id,
CreatedAt: dbtime.Now(),
AgentID: dbAgent.ID,
Slug: slug,