Skip to content

- artifacts automatically stick to user session#11

Merged
roxblnfk merged 1 commit into
mainfrom
feature/sticky-artifacts
Oct 15, 2025
Merged

- artifacts automatically stick to user session#11
roxblnfk merged 1 commit into
mainfrom
feature/sticky-artifacts

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

This pull request refactors how the user_id is determined when creating an artifact in the artifact_repo.create function. The main improvement is ensuring that the user_id is always associated with the session if a valid session_id is provided, otherwise it falls back to the authenticated actor. This change improves data consistency and aligns artifact ownership with session context.

Session handling and user association:

  • The logic for determining user_id now checks if a valid session_id is provided; if so, it retrieves user_id from the session record, otherwise it uses the authenticated actor's ID. [1] [2]
  • The session existence check now selects both session_id and user_id from the sessions table, ensuring the correct user association for artifacts created within a session.

Code clarity and cleanup:

  • Removed redundant comments and streamlined code for building and executing the artifact insertion query, making the function easier to read and maintain.

@roxblnfk roxblnfk merged commit 260db86 into main Oct 15, 2025
@roxblnfk roxblnfk deleted the feature/sticky-artifacts branch October 15, 2025 18:53
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

Successfully merging this pull request may close these issues.

2 participants