Skip to content

✨ fix: include eeid & improve misc settings dump#2303

Merged
mkmccarty merged 1 commit intomainfrom
mm-branch-1
Apr 2, 2026
Merged

✨ fix: include eeid & improve misc settings dump#2303
mkmccarty merged 1 commit intomainfrom
mm-branch-1

Conversation

@mkmccarty
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 2, 2026 19:52
@mkmccarty mkmccarty merged commit c84a67c into main Apr 2, 2026
11 of 12 checks passed
@mkmccarty mkmccarty deleted the mm-branch-1 branch April 2, 2026 19:52
Copy link
Copy Markdown
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 updates the Egg Inc coop-status fetch logic to optionally use an alternate endpoint with a user-specific EEID override (gated by a global guild setting), and improves the misc settings “dump” output to show raw values plus parsed CSV items with snowflake resolution.

Changes:

  • Extend ei.GetCoopStatus / ei.GetCoopStatusForCompletedContracts to accept an eeidOverride and optionally switch to /ei/coop_status.
  • Wire a feature-toggle callback from main.go (DEFAULT.coop_status_fix == "1") to enable the alternate endpoint.
  • Improve misc settings dump formatting and update all call sites for the new function signatures (including passing encrypted_ei_id for replay completed-contract lookups).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/ei/coop_status.go Adds EEID override + feature toggle hook, and switches endpoint when enabled.
main.go Wires ei.CoopStatusFixEnabled to a guild setting to avoid import cycles.
src/boost/replay.go Passes the user’s encrypted_ei_id into completed-contract coop-status fetches.
src/guildstate/slashcmd.go Makes misc settings dump include raw values and parsed items with resolutions.
src/track/track_update.go Updates GetCoopStatus call site for new signature.
src/boost/teamwork.go Updates GetCoopStatus call site for new signature.
src/boost/stones.go Updates GetCoopStatus call site for new signature.
src/boost/contract_report.go Updates GetCoopStatusForCompletedContracts call site for new signature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +45 to +51
func GetCoopStatus(contractID string, coopID string, eeidOverride string) (*ContractCoopStatusResponse, time.Time, string, error) {
eggIncID := config.EIUserIDBasic
reqURL := "https://www.auxbrain.com/ei/coop_status_bot"
if eeidOverride != "" && CoopStatusFixEnabled != nil && CoopStatusFixEnabled() {
eggIncID = DecryptEID(eeidOverride)
reqURL = "https://www.auxbrain.com/ei/coop_status"
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

When eeidOverride is provided and the fix is enabled, this switches to the user-authenticated coop_status endpoint but still uses the same in-memory cache key / file cache scheme (keyed only by contractID+coopID later in the function). That can let a response fetched with one user’s Egg Inc ID be served from cache to other callers (or to callers using the bot endpoint), effectively bypassing the endpoint’s authorization. Consider either including the effective Egg Inc ID + endpoint in the cache key / filename, or disabling cache reads/writes when using eeidOverride.

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +51
if eeidOverride != "" && CoopStatusFixEnabled != nil && CoopStatusFixEnabled() {
eggIncID = DecryptEID(eeidOverride)
reqURL = "https://www.auxbrain.com/ei/coop_status"
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

DecryptEID returns an empty string on decode/decrypt failure, but the code will still proceed and send a request with UserId="" when eeidOverride is set. That likely yields confusing Unauthorized errors and can also poison caches with a response keyed only by contract+coop. Consider validating the decrypted ID (non-empty, looks like an EI* ID) and either falling back to the bot ID/endpoint or returning a clear error.

Copilot uses AI. Check for mistakes.
Comment on lines +217 to +223
func GetCoopStatusForCompletedContracts(contractID string, coopID string, eeidOverride string) (*ContractCoopStatusResponse, time.Time, string, error) {
eggIncID := config.EIUserIDBasic
reqURL := "https://www.auxbrain.com/ei/coop_status_bot"
if eeidOverride != "" && CoopStatusFixEnabled != nil && CoopStatusFixEnabled() {
eggIncID = DecryptEID(eeidOverride)
reqURL = "https://www.auxbrain.com/ei/coop_status"
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The pb-completed on-disk cache is keyed only by contractID+coopID, but with eeidOverride enabled this function may fetch via the user-authenticated coop_status endpoint. Persisting that response to a shared filename allows later callers without the same Egg Inc ID (or without any ID) to read the cached data and bypass authorization. Consider namespacing the completed-cache filename by effective Egg Inc ID / endpoint, or skipping disk cache when eeidOverride is used.

Copilot uses AI. Check for mistakes.
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