Don't retry for PublicKeyNotFound

We only return `nil` when we know the person, but don't know the key or
the key is invalid, so it doesn't make sense to retry in this case. When
the person isn't known and can't be fetched we raise a DiscoveryError
which will be retried.

Also the errors were moved to the `Signable` module in the last release.

closes #7717
This commit is contained in:
Benjamin Neff 2018-02-17 20:56:39 +01:00 committed by Dennis Schubert
parent 602a1dcd55
commit f0aca56c8f
No known key found for this signature in database
GPG key ID: 5A0304BEA7966D7E
3 changed files with 4 additions and 2 deletions

View file

@ -7,6 +7,7 @@
## Bug fixes
* Prevent duplicate mention notifications when the post is received twice [#7721](https://github.com/diaspora/diaspora/pull/7721)
* Fixed a compatiblitiy issue with non-diaspora\* webfingers [#7718](https://github.com/diaspora/diaspora/pull/7718)
* Don't retry federation for accounts without a valid public key [#7717](https://github.com/diaspora/diaspora/pull/7717)
## Features
* Add basic html5 audio/video embedding support [#6418](https://github.com/diaspora/diaspora/pull/6418)

View file

@ -13,7 +13,8 @@ module Workers
DiasporaFederation::Parsers::BaseParser::InvalidRootNode,
DiasporaFederation::Entity::InvalidEntityName,
DiasporaFederation::Entity::UnknownEntity,
DiasporaFederation::Entities::Relayable::SignatureVerificationFailed,
DiasporaFederation::Entities::Signable::PublicKeyNotFound,
DiasporaFederation::Entities::Signable::SignatureVerificationFailed,
DiasporaFederation::Entities::Participation::ParentNotLocal,
DiasporaFederation::Federation::Receiver::InvalidSender,
DiasporaFederation::Federation::Receiver::NotPublic,

View file

@ -231,7 +231,7 @@ describe "diaspora federation callbacks" do
expect(key.to_s).to eq(person.serialized_public_key)
end
it "returns nil for an unknown person" do
it "forwards the DiscoveryError when the person can't be fetched" do
diaspora_id = Fabricate.sequence(:diaspora_id)
expect(Person).to receive(:find_or_fetch_by_identifier).with(diaspora_id)
.and_raise(DiasporaFederation::Discovery::DiscoveryError)