Skip to content

IIS: duplicate <preConditions> singleton collision in WebP/AVIF rewrite-rules classes #1180

Description

@Honemo

🤖 AI-generated — created by an automated pipeline. Review before acting on this.

Source: Follow-up from grooming of issue #509 (COULD_HAVE)

Context
While addressing the critical bug in #509 (duplicate <staticContent> blocks in IIS web.config causing site-wide 500 errors), a related architectural pattern was identified in the sibling rewrite-rules producer classes.

The classes/Webp/RewriteRules/IIS.php and classes/Avif/RewriteRules/IIS.php classes use the same underlying architecture via classes/WriteFile/AbstractIISDirConfFile.php, which exhibits the same root-cause issue: the get_node()/prepend_node() methods perform blind-prepend operations without deduplication logic.

This can produce duplicate <preConditions> singleton node collisions in generated IIS rewrite rules. While #509 was kept focused on the <staticContent> fix, this issue was explicitly scoped out per user decision during grooming.

Suggestion
Apply the same fix pattern from #509 to the rewrite-rules classes. Reference the root-cause analysis in .ai/issues/509/spec.md for AbstractIISDirConfFile.php behavior details.

Acceptance Criteria

Related Issues

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions