Skip to content

Commit

Permalink
Fix merge conflict (#16402)
Browse files Browse the repository at this point in the history
Fix conflict with dev.
Also make sure we emit an event for resyncing permission on project folders, once we create a new remote identity entry
  • Loading branch information
mereghost authored Aug 12, 2024
1 parent 22e6438 commit 1f3fae7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 5 additions & 1 deletion app/services/remote_identities/create_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def initialize(user:, oauth_config:, oauth_token:)

def call
@model.origin_user_id = @oauth_config.extract_origin_user_id(@oauth_token)
@result.success = false unless @model.save
if @model.save
emit_event(@oauth_config.oauth_client.integration)
else
@result.success = false
end

@result
end
Expand Down
14 changes: 8 additions & 6 deletions spec/services/oauth_clients/connection_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
# Copyright (C) the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
Expand Down Expand Up @@ -522,11 +522,13 @@
end

it "returns a ServiceResult with success, without refresh" do
expect(subject.success).to be_truthy
expect(subject).to be yield_service_result2
expect(instance).to have_received(:refresh_token)
expect(oauth_client_token).to have_received(:reload)
expect(yield_double_object).to have_received(:yield_twice_method).twice
without_partial_double_verification do
expect(subject.success).to be_truthy
expect(subject).to be yield_service_result2
expect(instance).to have_received(:refresh_token)
expect(oauth_client_token).to have_received(:reload)
expect(yield_double_object).to have_received(:yield_twice_method).twice
end
end
end
end
Expand Down

0 comments on commit 1f3fae7

Please sign in to comment.