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

Bugfix/account deployment via cmd fix initial setup #5320

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

allexzander
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Merging #5320 (ac1abb2) into master (0f4a0de) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5320      +/-   ##
==========================================
- Coverage   57.98%   57.97%   -0.01%     
==========================================
  Files         141      141              
  Lines       18113    18116       +3     
==========================================
  Hits        10503    10503              
- Misses       7610     7613       +3     
Impacted Files Coverage Δ
src/libsync/account.cpp 36.12% <0.00%> (-0.14%) ⬇️
src/libsync/account.h 36.84% <ø> (ø)
src/libsync/creds/abstractcredentials.h 50.00% <ø> (ø)
src/libsync/creds/dummycredentials.cpp 0.00% <ø> (ø)
src/libsync/creds/dummycredentials.h 0.00% <ø> (ø)
src/libsync/creds/httpcredentials.cpp 6.89% <0.00%> (-0.02%) ⬇️
src/libsync/creds/httpcredentials.h 20.00% <ø> (ø)

Copy link
Collaborator

@mgallien mgallien left a comment

Choose a reason for hiding this comment

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

a single minor comment

src/gui/accountsetupfromcommandlinejob.h Outdated Show resolved Hide resolved
@allexzander allexzander force-pushed the bugfix/account-deployment-via-cmd-fix-initial-setup branch from 22fad82 to 0305762 Compare January 19, 2023 14:31
@nextcloud-desktop-bot
Copy link

AppImage file: nextcloud-PR-5320-030576215904fca1bb91cef52de9c54bdb1c813c-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@allexzander allexzander force-pushed the bugfix/account-deployment-via-cmd-fix-initial-setup branch from 0305762 to ac1abb2 Compare February 6, 2023 09:50
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 6, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 20 Code Smells

26.5% 26.5% Coverage
0.0% 0.0% Duplication

Copy link
Collaborator

@claucambra claucambra left a comment

Choose a reason for hiding this comment

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

Mostly nitpicks

src/gui/accountmanager.cpp Show resolved Hide resolved
src/gui/accountmanager.h Show resolved Hide resolved

/// Sets account id if not set (call only before adding it to the AccountManager)
void setIdForAccount(OCC::Account *a);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
void setIdForAccount(OCC::Account *a);
void setIdForAccount(OCC::Account *account);


const auto userIdParsed = QStringLiteral("%1@%2").arg(userIdSplit.first()).arg(_serverUrl.host());

if (AccountManager::instance()->accountFromUserId(QStringLiteral("%1@%2").arg(_userId).arg(_serverUrl.host())) || AccountManager::instance()->accountFromUserId(userIdParsed)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: a little more readable (and safe, not that it's likely to matter)

Suggested change
if (AccountManager::instance()->accountFromUserId(QStringLiteral("%1@%2").arg(_userId).arg(_serverUrl.host())) || AccountManager::instance()->accountFromUserId(userIdParsed)) {
if (const auto accManager = AccountManager::instance();
accManager->accountFromUserId(QStringLiteral("%1@%2").arg(_userId).arg(_serverUrl.host())) ||
accManager->accountFromUserId(userIdParsed)) {

}
}

void AccountSetupFromCommandLineJob::accountCredentialsWriteJoobDone()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
void AccountSetupFromCommandLineJob::accountCredentialsWriteJoobDone()
void AccountSetupFromCommandLineJob::accountCredentialsWriteJobDone()

src/libsync/creds/httpcredentials.h Show resolved Hide resolved
test/endtoendtestutils.h Show resolved Hide resolved
@@ -203,7 +203,7 @@ bool CredentialsStub::stillValid(QNetworkReply * /*reply*/)
return false;
}

void CredentialsStub::persist() { }
void CredentialsStub::persist(bool saveAccount) { Q_UNUSED(saveAccount) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
void CredentialsStub::persist(bool saveAccount) { Q_UNUSED(saveAccount) }
void CredentialsStub::persist(const bool saveAccount) { Q_UNUSED(saveAccount) }

test/pushnotificationstestutils.h Show resolved Hide resolved
test/syncenginetestutils.h Show resolved Hide resolved
@camilasan
Copy link
Member

Why we never merged this?

@Rello Rello added this to the 3.15.3 milestone Dec 20, 2024
@mgallien mgallien modified the milestones: 3.15.3, 3.16.0 Jan 3, 2025
@camilasan camilasan modified the milestones: 3.16.0, 3.17.0 Feb 10, 2025
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.

6 participants