Skip to content

Conversation

@maxschwinghammer
Copy link
Collaborator

Summary

  • dynamically resolve household ID when adding or updating inventory items
  • record inventory activity against the current household

Testing

  • bash ./gradlew test (fails: /workspace/AndroidApp/app/keys.properties (No such file or directory))

https://chatgpt.com/codex/tasks/task_b_68a70fbbad3883279ee430be12544b8e

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes inventory retrieval for joined households by dynamically resolving the household ID during inventory operations rather than caching it at initialization time. This ensures that inventory activities are properly recorded against the current household when users switch between households.

  • Removes cached household ID initialization and resolves it dynamically during operations
  • Updates inventory activity logging to use the current household ID
  • Refactors async operations to use suspend functions with await() instead of callback-based patterns

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

else -> null
}

val householdId = householdService.getHouseholdId()
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The household ID is retrieved synchronously on the main thread during addProduct. Consider moving this call inside the coroutine scope or making it suspend to avoid potential UI blocking.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

else -> activityType
}

val currentHouseholdId = householdService.getHouseholdId()
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The household ID is retrieved synchronously in logActivity method. If this method is called from a coroutine context, consider making getHouseholdId() a suspend function to avoid blocking calls.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI commented Oct 29, 2025

@maxschwinghammer I've opened a new pull request, #219, to work on those changes. Once the pull request is ready, I'll request review from you.

…ceImpl.kt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants