Skip to content

fix(session): initialize data lazily in save() to prevent uninitialized property access - #252

Merged
chr-hertel merged 1 commit into
modelcontextprotocol:mainfrom
soyuka:fix/data-session
Mar 4, 2026
Merged

chr-hertel merged 1 commit into
modelcontextprotocol:mainfrom
soyuka:fix/data-session

Conversation

@soyuka

@soyuka soyuka commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

I think the code is self-explanatory

@soyuka

soyuka commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

If someone can re-run the pipeline it'd be lovely :)

@chr-hertel chr-hertel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch, thanks!

@chr-hertel
chr-hertel merged commit 61c20f1 into modelcontextprotocol:main Mar 4, 2026
21 of 34 checks passed
vitek-rostislav added a commit to shopsys/shopsys that referenced this pull request Jul 31, 2026
- fixes the production error "Typed property Mcp\Server\Session\Session::$data
must not be accessed before initialization"
- see the fix in mcp/sdk 0.5.0+ (modelcontextprotocol/php-sdk#252)
- removed the mcp.discovery.scan_dirs prepend, file-based discovery was replaced by container registration of #[McpTool] attributed services
- set http.allowed_hosts: false, the DNS rebinding protection introduced in 0.11 defaults to localhost-only and would block the public MCP endpoint, which is protected by OAuth tokens instead
vitek-rostislav added a commit to shopsys/shopsys that referenced this pull request Aug 4, 2026
- fixes the production error "Typed property Mcp\Server\Session\Session::$data
must not be accessed before initialization"
- see the fix in mcp/sdk 0.5.0+ (modelcontextprotocol/php-sdk#252)
- removed the mcp.discovery.scan_dirs prepend, file-based discovery was replaced by container registration of #[McpTool] attributed services
- set http.allowed_hosts: false, the DNS rebinding protection introduced in 0.11 defaults to localhost-only and would block the public MCP endpoint, which is protected by OAuth tokens instead
ShopsysBot pushed a commit to shopsys/mcp that referenced this pull request Aug 4, 2026
- fixes the production error "Typed property Mcp\Server\Session\Session::$data
must not be accessed before initialization"
- see the fix in mcp/sdk 0.5.0+ (modelcontextprotocol/php-sdk#252)
- removed the mcp.discovery.scan_dirs prepend, file-based discovery was replaced by container registration of #[McpTool] attributed services
- set http.allowed_hosts: false, the DNS rebinding protection introduced in 0.11 defaults to localhost-only and would block the public MCP endpoint, which is protected by OAuth tokens instead
ShopsysBot pushed a commit to shopsys/project-base that referenced this pull request Aug 4, 2026
- fixes the production error "Typed property Mcp\Server\Session\Session::$data
must not be accessed before initialization"
- see the fix in mcp/sdk 0.5.0+ (modelcontextprotocol/php-sdk#252)
- removed the mcp.discovery.scan_dirs prepend, file-based discovery was replaced by container registration of #[McpTool] attributed services
- set http.allowed_hosts: false, the DNS rebinding protection introduced in 0.11 defaults to localhost-only and would block the public MCP endpoint, which is protected by OAuth tokens instead
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