Skip to content

🪲 BUG-#130: Fix mutable default arguments in Config.__init__ causing shared state - #150

Merged
FernandoCelmer merged 3 commits into
developfrom
feature/130
Apr 7, 2026
Merged

🪲 BUG-#130: Fix mutable default arguments in Config.__init__ causing shared state#150
FernandoCelmer merged 3 commits into
developfrom
feature/130

Conversation

@FernandoCelmer

@FernandoCelmer FernandoCelmer commented Apr 6, 2026

Copy link
Copy Markdown
Member

Description

  • dotflow/core/config.py: Replace mutable default arguments with None defaults, instantiating providers inside the method body using explicit is not None checks

Motivation and Context

Default argument values in Python are evaluated once at class definition time. All Config() instances without explicit arguments shared the same provider objects (StorageDefault, NotifyDefault, etc.), causing state leak between workflows. Using if is not None else instead of or ensures falsy but valid provider instances are not silently replaced.

Closes #130

Types of changes

  • Bug fix (change that fixes an issue)
  • New feature (change which adds functionality)
  • Documentation

Checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the CHANGELOG
  • I have updated the documentation accordingly

@FernandoCelmer FernandoCelmer added bug Something isn't working critical Critical severity - must fix labels Apr 6, 2026
@FernandoCelmer FernandoCelmer self-assigned this Apr 6, 2026
@FernandoCelmer
FernandoCelmer deleted the feature/130 branch April 7, 2026 02:00
@FernandoCelmer
FernandoCelmer restored the feature/130 branch April 7, 2026 02:02
@FernandoCelmer FernandoCelmer reopened this Apr 7, 2026
@FernandoCelmer
FernandoCelmer merged commit 62d272d into develop Apr 7, 2026
20 checks passed
@FernandoCelmer
FernandoCelmer deleted the feature/130 branch April 7, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working critical Critical severity - must fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant