🤖 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
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.phpandclasses/Avif/RewriteRules/IIS.phpclasses use the same underlying architecture viaclasses/WriteFile/AbstractIISDirConfFile.php, which exhibits the same root-cause issue: theget_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.phpbehavior details.Acceptance Criteria
classes/Webp/RewriteRules/IIS.phpgenerates unique<preConditions>nodes without duplicatesclasses/Avif/RewriteRules/IIS.phpgenerates unique<preConditions>nodes without duplicatesAbstractIISDirConfFile.phpdeduplication behavior is aligned with Check if rules already exist in IIS (Windows) web.config file #509 fix strategyRelated Issues
<staticContent>fix