From 3a17546b4fa52ef83a55805ebb3e0624225cb7eb Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Sun, 2 Mar 2025 23:49:15 -0500 Subject: [PATCH] fix github download timing, and CORS issues --- .../Pipeline/Sections/SyncTags/LoadGitHubTagsBlock.cs | 4 ++-- .../Pipeline/Sections/SyncTags/SyncTagsSection.cs | 2 +- rubberduckvba.Server/RubberduckApiController.cs | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rubberduckvba.Server/ContentSynchronization/Pipeline/Sections/SyncTags/LoadGitHubTagsBlock.cs b/rubberduckvba.Server/ContentSynchronization/Pipeline/Sections/SyncTags/LoadGitHubTagsBlock.cs index 1fca8e9..a6c1b65 100644 --- a/rubberduckvba.Server/ContentSynchronization/Pipeline/Sections/SyncTags/LoadGitHubTagsBlock.cs +++ b/rubberduckvba.Server/ContentSynchronization/Pipeline/Sections/SyncTags/LoadGitHubTagsBlock.cs @@ -4,7 +4,7 @@ namespace rubberduckvba.Server.ContentSynchronization.Pipeline.Sections.SyncTags; -public class LoadGitHubTagsBlock : TransformBlockBase +public class LoadGitHubTagsBlock : TransformBlockBase { private readonly IGitHubClientService _github; @@ -14,7 +14,7 @@ public LoadGitHubTagsBlock(PipelineSection parent, CancellationToke _github = github; } - public override async Task TransformAsync(SyncRequestParameters input) + public override async Task TransformAsync(SyncContext input) { var githubTags = await _github.GetAllTagsAsync(Context.RubberduckDbMain.Name); var (gitHubMain, gitHubNext, gitHubOthers) = githubTags.GetLatestTags(); diff --git a/rubberduckvba.Server/ContentSynchronization/Pipeline/Sections/SyncTags/SyncTagsSection.cs b/rubberduckvba.Server/ContentSynchronization/Pipeline/Sections/SyncTags/SyncTagsSection.cs index 143576b..b8cec89 100644 --- a/rubberduckvba.Server/ContentSynchronization/Pipeline/Sections/SyncTags/SyncTagsSection.cs +++ b/rubberduckvba.Server/ContentSynchronization/Pipeline/Sections/SyncTags/SyncTagsSection.cs @@ -73,7 +73,7 @@ public override void CreateBlocks() AcquireDbNextTag.CreateBlock(BroadcastParameters); JoinDbTags.CreateBlock(AcquireDbMainTag, AcquireDbNextTag); LoadDbTags.CreateBlock(JoinDbTags); - LoadGitHubTags.CreateBlock(BroadcastParameters); + LoadGitHubTags.CreateBlock(LoadDbTags); JoinTags.CreateBlock(LoadDbTags, LoadGitHubTags); BroadcastTags.CreateBlock(JoinTags); StreamGitHubTags.CreateBlock(BroadcastTags); diff --git a/rubberduckvba.Server/RubberduckApiController.cs b/rubberduckvba.Server/RubberduckApiController.cs index 2f40dbf..5a59290 100644 --- a/rubberduckvba.Server/RubberduckApiController.cs +++ b/rubberduckvba.Server/RubberduckApiController.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.Mvc; using rubberduckvba.Server; using System.Diagnostics; using System.Runtime.CompilerServices; @@ -6,6 +7,7 @@ namespace rubberduckvba.Server; [ApiController] +[EnableCors("CorsPolicy")] public abstract class RubberduckApiController : ControllerBase { private readonly ILogger _logger;