Skip to content

Fix stale refresh generation handling after PR #386 #390

@karthiknadig

Description

@karthiknadig

Summary

The original refresh deduplication work in #383 left a follow-up correctness gap after PR #386 was merged.

A refresh that started under an older configuration generation could still:

  • emit stale environment, manager, or telemetry notifications after a newer configure, and
  • reserve the one-time missing-environment follow-up work in a way that could block the current generation from reporting it.

Expected behavior

Once configuration generation advances, stale refresh work should not:

  • sync locator refresh state back into shared locators,
  • emit refresh notifications for the old generation, or
  • permanently steal the missing-env reporting slot from the current generation.

Proposed fix

  • make refresh notification emission generation-aware and atomic with the generation check,
  • keep stale refresh state sync blocked,
  • replace the missing-env one-shot boolean with generation-stamped reservation semantics so newer generations can supersede stale reservations,
  • add regression tests for the stale-generation reporter and missing-env reservation behavior.

Context

This follow-up comes from Copilot review comments discovered after the original PR was merged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions