Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve DynamicWorldContainer #3022

Merged
merged 5 commits into from
Dec 20, 2024
Merged

resolve DynamicWorldContainer #3022

merged 5 commits into from
Dec 20, 2024

Conversation

NickKhalow
Copy link
Contributor

What does this PR change?

Solved issue:
It's possible to pass an uninitialized dependency to an object that requires it. For example, you might pass container.ChatMessagesBus, assuming it's initialized, but in reality, it's only initialized dozens of lines later. This can lead to a null reference error in a completely different part of the code due to the invalid dependency.
To solve this, I propose to make DynamicWorldContainer immutable and construct it only at the return steps. This approach will prevent such issues at compile time by ensuring that references cannot be passed before they are initialized.

How to test the changes?

  1. Launch the explorer
  2. Play happy path

Our Code Review Standards

https://github.com/decentraland/unity-renderer/blob/master/docs/code-review-standards.md

Copy link
Contributor

github-actions bot commented Dec 18, 2024

badge

New build in progress, come back later!

# Conflicts:
#	Explorer/Assets/DCL/PerformanceAndDiagnostics/Analytics/Systems/AnalyticsPlugin.cs
#	Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs
Copy link

@Ludmilafantaniella Ludmilafantaniella left a comment

Choose a reason for hiding this comment

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

🟢 Smoke test performed on both mac and windows covering:

  • Login
  • Quest progression (Salad Slash, Memory Circus)
  • Social interactions (chats, passport, emotes sync)
  • Teleport using the GP carrousel, map and chat commands
  • Scene/world visited: Casa Roustan, Olavra, Metadynelabs, Exodus
  • Backpack - wreables and emotes
  • Emote wheel
  • Sidebar shortcuts

Copy link
Collaborator

@AnsisMalins AnsisMalins left a comment

Choose a reason for hiding this comment

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

I find no faults.

# Conflicts:
#	Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs
@NickKhalow NickKhalow merged commit 8514b27 into dev Dec 20, 2024
1 of 2 checks passed
@NickKhalow NickKhalow deleted the enhance/dynamic-container branch December 20, 2024 16:52
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.

3 participants