Skip to content

V16/firstboot onstartup conflict fix#824

Merged
KevinJump merged 6 commits into
v16/mainfrom
v16/firstboot-onstartup-conflict-fix
Oct 8, 2025
Merged

V16/firstboot onstartup conflict fix#824
KevinJump merged 6 commits into
v16/mainfrom
v16/firstboot-onstartup-conflict-fix

Conversation

@KevinJump

Copy link
Copy Markdown
Owner

Fixes an issue with FirstBoot, where content isn't published at the end (like it is with ImportAtStartup)

  • FirstBoot runs in a migration and is now UnScoped so we can control the context like we do for the ImportAtstartup version, so they both work the same.
  • Added a Check to the uSync StartupImportAsync method so it generats a hash of the passed in parameters and will only run that import once. This means if firstboot and importonStartup are importing the same things - it only runs once, but if they are different they will both run.
  • the call in ImportOnStartup was StartupImportAsync(...).Wait() when its in an async method so it can be async StartupImportAsync(...)

@KevinJump KevinJump requested a review from Copilot October 8, 2025 11:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a conflict issue between FirstBoot and ImportAtStartup functionality in uSync, ensuring content is properly published during FirstBoot operations and preventing duplicate imports when both features use the same parameters.

Key changes:

  • Added deduplication logic to prevent duplicate startup imports with identical parameters
  • Converted FirstBoot to use UnScoped migration pattern with proper context management
  • Fixed async/await pattern in ImportOnStartup notification handler

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
SyncService.cs Added hash-based deduplication for startup imports to prevent conflicts
uSyncApplicationStartingHandler.cs Fixed async/await pattern by removing .Wait() call
FirstBootMigration.cs Converted to UnScoped migration with proper context management and server role checks

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread uSync.BackOffice/Services/SyncService.cs Outdated
Comment thread uSync.BackOffice/Boot/FirstBootMigration.cs Outdated
@KevinJump KevinJump merged commit 1a4fe16 into v16/main Oct 8, 2025
1 check passed
alexsee pushed a commit to alexsee/umbraco-container that referenced this pull request Dec 6, 2025
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Updated [uSync](https://github.com/KevinJump/uSync) from 16.0.5 to
16.1.0.

<details>
<summary>Release notes</summary>

_Sourced from [uSync's
releases](https://github.com/KevinJump/uSync/releases)._

## 16.1.0

This is a minor update to uSync for Umbraco v16, it contains feature
updates to how BlockList/Grid merges are reported and the ability to
merge uSync files for multiple items into single files so they can be
read in one block from the server (no UI for this, feature will likely
be enabled via the uSync.Cli).

## What's Changed
* V16/block converters two by @​KevinJump in
KevinJump/uSync#822
* pass latest content version between passes. by @​KevinJump in
KevinJump/uSync#823
* V16/firstboot on startup conflict fix by @​KevinJump in
KevinJump/uSync#824
* Add operation security filter so swagger auth is allowed. by
@​KevinJump in KevinJump/uSync#825
* Share second pass actions across commonn IContentBase objects by
@​KevinJump in KevinJump/uSync#826
* Rix #​827 - Removal's code was trying to modify array inside loop of
array by @​KevinJump in KevinJump/uSync#828
* V16/multiple nodes per file by @​KevinJump in
KevinJump/uSync#829

**Full Changelog**:
KevinJump/uSync@v16.0.8...v16.1.0

This will be the last 'feature' release of uSync for Umbraco v16 as we
move on to supporting and targeting Umbraco v17 (see
https://docs.jumoo.co.uk/SupportLifecycles#Short-Term-Support-STS-Releases)

## 16.0.8

This is a patch release of uSync for Umbraco, it contains some fixes
issues around imports on startup and UI messages.

## What's Changed
* update package.json dependencies. by @​KevinJump in
KevinJump/uSync#819
* Offer more granular updates to the ordering process by @​KevinJump in
KevinJump/uSync#820
* Get Correct Content version on second pass events. by @​KevinJump in
KevinJump/uSync#821


**Full Changelog**:
KevinJump/uSync@v16.0.7...v16.0.8

## 16.0.7

This is a patch release for uSync for Umbraco v16 - it contains some
fixes and updates based on reported issues.

## What's Changed
* Some string changes to reduce some allocations here and there. by
@​KevinJump in KevinJump/uSync#808
* Fix #​803 (again) ensure the self referencing nodes are removed by
@​KevinJump in KevinJump/uSync#809
* only check for legacy when the default folder hasn't been changed. by
@​KevinJump in KevinJump/uSync#810
* V16/dashboard tweaks by @​KevinJump in
KevinJump/uSync#811
* normalize string media paths into JSON croppers for consistancy. by
@​KevinJump in KevinJump/uSync#812
* Fix: Compiled Views Content by @​KevinJump in
KevinJump/uSync#813
* move away from uui-table-row by @​KevinJump in
KevinJump/uSync#814
* v16 fix of #​815 by @​KevinJump in
KevinJump/uSync#818


**Full Changelog**:
KevinJump/uSync@v16.0.5...v16.0.7

Commits viewable in [compare
view](KevinJump/uSync@v16.0.5...v16.1.0).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=uSync&package-manager=nuget&previous-version=16.0.5&new-version=16.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

> **Note**
> Automatic rebases have been disabled on this pull request as it has
been open for over 30 days.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@KevinJump KevinJump deleted the v16/firstboot-onstartup-conflict-fix branch January 13, 2026 10:39
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