Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ private void HandleOffset([Data] float dt, ref CameraComponent cameraComponent,
{
ThirdPersonCameraShoulder.Right => ThirdPersonCameraShoulder.Left,
ThirdPersonCameraShoulder.Left => ThirdPersonCameraShoulder.Right,
ThirdPersonCameraShoulder.Center => ThirdPersonCameraShoulder.Right,
};

ThirdPersonCameraShoulder thirdPersonCameraShoulder = cameraComponent.Shoulder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public class CharacterPreviewAvatarContainer : MonoBehaviour, IDisposable
private bool isFOVTransitioning;

[field: SerializeField] internal Vector3 previewPositionInScene { get; private set; }
[field: SerializeField] internal Transform avatarParent { get; private set; }
[field: SerializeField] internal Camera camera { get; private set; }
[field: SerializeField] internal Transform cameraTarget { get; private set; }
[field: SerializeField] internal Transform rotationTarget { get; private set; }
[field: SerializeField] internal CinemachineFreeLook freeLookCamera { get; private set; }
[field: SerializeField] internal GameObject previewPlatform { get; private set; }
[field: SerializeField] internal AvatarPreviewHeadIKSettings headIKSettings { get; private set; }
[field: SerializeField] internal Transform avatarParent { get; private set; } = null!;
[field: SerializeField] internal new Camera camera { get; private set; } = null!;
[field: SerializeField] internal Transform cameraTarget { get; private set; } = null!;
[field: SerializeField] internal Transform rotationTarget { get; private set; } = null!;
[field: SerializeField] internal CinemachineFreeLook freeLookCamera { get; private set; } = null!;
[field: SerializeField] internal GameObject previewPlatform { get; private set; } = null!;
[field: SerializeField] internal AvatarPreviewHeadIKSettings headIKSettings { get; private set; } = null!;

internal float TargetFOV { get; set; }
internal float RotationModifier { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public abstract class FriendPanelSectionControllerBase<T, U> : IDisposable
protected readonly U requestManager;

private CancellationTokenSource friendListInitCts = new ();
private bool disposed;

protected UniTaskCompletionSource? panelLifecycleTask { get; private set; }

Expand All @@ -40,6 +41,7 @@ public virtual void Dispose()
view.Disable -= Disable;
requestManager.Dispose();
friendListInitCts.SafeCancelAndDispose();
disposed = true;
}

public async UniTask InitAsync(CancellationToken ct)
Expand All @@ -53,6 +55,9 @@ public async UniTask InitAsync(CancellationToken ct)
if (!result.Success)
return;

if (ct.IsCancellationRequested)
return;

view.SetLoadingState(false);

bool showScrollView = ShouldShowScrollView();
Expand All @@ -73,6 +78,9 @@ public virtual void Reset() =>

protected void CheckShouldInit()
{
if (disposed)
return;

if (!requestManager.WasInitialised)
InitAsync(friendListInitCts.Token).Forget();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,28 @@ public class SectionLoadingView : MonoBehaviour
[field: SerializeField] public LoadingBrightView LoadingBright { get; private set; }
[field: SerializeField] public float FadeDuration { get; private set; } = 0.3f;

private Tweener? fadeTween;

public void Show()
{
fadeTween?.Kill();
CanvasGroup.alpha = 1;
CanvasGroup.blocksRaycasts = true;
LoadingBright.StartLoadingAnimation(null);
}

public void Hide()
{
CanvasGroup.DOFade(0, FadeDuration).OnComplete(() => CanvasGroup.blocksRaycasts = false);
fadeTween?.Kill();
fadeTween = CanvasGroup.DOFade(0, FadeDuration).OnComplete(() => CanvasGroup.blocksRaycasts = false);
LoadingBright.FinishLoadingAnimation(null);
}

private void OnDestroy()
{
// Without this the fade outlives panel teardown and DOTween keeps driving the destroyed CanvasGroup.
fadeTween?.Kill();
fadeTween = null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace DCL.DebugUtilities.UIBindings
/// </summary>
public class ElementBinding<T> : IElementBinding<T>
{
private T tempValue;
private T tempValue = default!;

private bool tempValueIsDirty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace DCL.DebugUtilities.Views
{
public abstract class DebugElementBase<TElement, TDef> : VisualElement where TElement: DebugElementBase<TElement, TDef> where TDef: IDebugElementDef
{
protected TDef definition { get; private set; }
protected TDef definition { get; private set; } = default!;

public void Initialize(TDef definition)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,26 @@ public virtual async UniTask<EnumResult<TaskError>> ExecuteAsync(string processN

if (!lastOpResult.Success)
{
ReportHub.LogError(
reportData,
$"Operation failed on {processName} attempt {attempt + 1}/{attemptsCount}: {lastOpResult.AsResult().ErrorMessage}"
);
// Do not log cancellation as an error (CLAUDE.md §9): on shutdown the inner op
// converts its OperationCanceledException into a TaskError.Cancelled result.
if (!ct.IsCancellationRequested && lastOpResult.Error?.State != TaskError.Cancelled)
ReportHub.LogError(
reportData,
$"Operation failed on {processName} attempt {attempt + 1}/{attemptsCount}: {lastOpResult.AsResult().ErrorMessage}"
);

break;
}
}
catch (OperationCanceledException) when (ct.IsCancellationRequested)
{
// Cancellation of the outer flow is not an error: convert to a cancelled result
// (the check below exits the attempt loop). An OperationCanceledException from an
// operation's internal token is NOT ours to absorb - it propagates as before, so
// the attempt loop cannot re-run the whole chain on an inner timeout.
lastOpResult = EnumResult<TaskError>.CancelledResult(TaskError.Cancelled);
break;
}
catch (Exception e)
{
lastOpResult = EnumResult<TaskError>.ErrorResult(TaskError.UnexpectedException, $"Unhandled exception on {processName} attempt {attempt + 1}/{attemptsCount}: {e}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ async UniTask<EnumResult<TaskError>> ExecuteLoadingScreenAsync()
SceneLoadingScreenController.IssueCommand(new SceneLoadingScreenController.Params(loadReport)), ct)
.SuppressToResultAsync(ReportCategory.SCENE_LOADING);

if (loadReport.GetStatus().TaskStatus == UniTaskStatus.Pending)
// Both logs below are pure cancellation artifacts on ExitPlayMode (the outer ct cancels ShowAsync,
// leaving loadReport Pending and result as TaskError.Cancelled). Only log when not cancelled (CLAUDE.md §9).
if (!ct.IsCancellationRequested && loadReport.GetStatus().TaskStatus == UniTaskStatus.Pending)
ReportHub.LogError(ReportCategory.SCENE_LOADING, "Loading screen finished unexpectedly, but the loading process continues");

if (finalResult.HasValue && !result.Success)
if (!ct.IsCancellationRequested && finalResult.HasValue && !result.Success)
ReportHub.LogError(ReportCategory.SCENE_LOADING, $"Loading screen finished with an error after the flow has finished: {result.Error.AsMessage()}");

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ private void Awake()

public void ClearTips()
{
// Application/view teardown can destroy the tip objects (children of this view) before
// ClearTips runs; skip the already-destroyed entries.
foreach (TipView tip in tips)
Destroy(tip.gameObject);
if (tip != null) Destroy(tip.gameObject);

foreach (TipBreadcrumb? breadcrumb in tipsBreadcrumbs)
Destroy(breadcrumb.gameObject);
if (breadcrumb != null) Destroy(breadcrumb.gameObject);

tips.Clear();
tipsBreadcrumbs.Clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async UniTask InitializeAsync(CancellationToken ct)
fallbackTips = Get(tipsTable, imagesTable, ct);
}

public async UniTask<SceneTips> GetAsync(CancellationToken ct) =>
public UniTask<SceneTips> GetAsync(CancellationToken ct) =>

// TODO: we will need specific scene tips in the future, but its disabled at the moment
/*StringTable tipsTable = await tipsDatabase.GetTableAsync($"LoadingSceneTips-{parcelCoord.x},{parcelCoord.y}").Task
Expand All @@ -60,7 +60,7 @@ public async UniTask<SceneTips> GetAsync(CancellationToken ct) =>
ct.ThrowIfCancellationRequested();

return await Get(tipsTable, imagesTable, ct);*/
fallbackTips;
UniTask.FromResult(fallbackTips);

private SceneTips Get(StringTable tipsTable, AssetTable? imagesTable, CancellationToken ct)
{
Expand Down
2 changes: 1 addition & 1 deletion Explorer/Assets/DCL/UI/Controls/ControlsPanel.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 4974685691c134a35bcea75af1936381, type: 3}
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 1
m_FillCenter: 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Cysharp.Threading.Tasks;
using DCL.Diagnostics;
using DCL.UI.Controls.Configs;
using System;
using System.Threading;
Expand Down Expand Up @@ -148,7 +149,8 @@ private async UniTaskVoid WaitAndTriggerExitAsync(CancellationToken token)
if (!isHovering)
ShowSubmenu(false);
}
catch (Exception) { }
catch (OperationCanceledException) { }
catch (Exception e) { ReportHub.LogException(e, ReportCategory.UI); }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ private Vector3 GetControlsPosition(ControlsContainerView container, Vector2 anc

float bestOutOfBoundsPercent = adjustedOutOfBoundsPercent;
float3 bestPosition = adjustedPosition;
var foundPerfectPosition = false;

for (var i = 0; i < fallbackDirectionsCount; i++)
{
Expand Down
Loading