···6363 const recordResult = await getRecordFromFullAtUri(inviteAtUri);
6464 if (!recordResult.ok) {
6565 console.error(
6666- `something went wrong fetching the record from the given membership ${JSON.stringify(membership)}`,
6666+ `something went wrong fetching the invite record from the given membership ${JSON.stringify(membership)}`,
6767 );
6868 throw new Error(
6969 JSON.stringify({ error: recordResult.error, membership }),
···7878 } catch (err) {
7979 return newErrorResponse(500, {
8080 message:
8181- "Something went wrong when fetching membership channel records. Check the Shard logs if possible.",
8181+ "Something went wrong when fetching membership invite records. Check the Shard logs if possible.",
8282 details: err,
8383 });
8484 }
···115115 const recordResult = await getRecordFromFullAtUri(channelAtUri);
116116 if (!recordResult.ok) {
117117 console.error(
118118- `something went wrong fetching the record from the given membership ${JSON.stringify(invite)}`,
118118+ `something went wrong fetching the channel record from the given membership ${JSON.stringify(invite)}`,
119119 );
120120 throw new Error(
121121 JSON.stringify({ error: recordResult.error, invite }),
···158158 // did of the backlink. if there are any channels described by unauthorised parties, simply drop them.
159159160160 let mismatchOrIncorrect = false;
161161+ const errors: Array<unknown> = [];
161162 const existingShardConnectionShardDids = shardSessions
162163 .keys()
163164 .toArray()
···175176 routeThroughRecord.uri,
176177 );
177178 if (!routeThroughRecordParseResult.ok) {
179179+ errors.push(routeThroughRecordParseResult.error);
178180 mismatchOrIncorrect = true;
179181 return;
180182 }
···183185 // FIXME: this also assumes that the requesting lattice's DID is a did:web
184186 // see below for the rest of the issues.
185187 if (routeThroughUri.rKey === SERVICE_DID.slice(8)) {
188188+ errors.push(
189189+ "Mismatch between claimant lattice and channel routeThrough. Request wants to validate for",
190190+ routeThroughUri.rKey,
191191+ ", but this lattice is",
192192+ SERVICE_DID.slice(8),
193193+ );
186194 mismatchOrIncorrect = true;
187195 return;
188196 }
189197 const storeAtRecordParseResult = stringToAtUri(storeAtRecord.uri);
190198 if (!storeAtRecordParseResult.ok) {
199199+ errors.push(storeAtRecordParseResult.error);
191200 mismatchOrIncorrect = true;
192201 return;
193202 }
···203212 if (!storeAtUri.rKey) return;
204213205214 if (!existingShardConnectionShardDids.includes(storeAtUri.rKey)) {
215215+ errors.push(
216216+ "Mismatch between claimant shard and channel storeAt. Request wants to validate for",
217217+ storeAtUri.rKey,
218218+ ", but this lattice is only allowed to talk to",
219219+ existingShardConnectionShardDids,
220220+ );
206221 mismatchOrIncorrect = true;
207222 return;
208223 }
···213228 return newErrorResponse(400, {
214229 message:
215230 "Channels provided during the handshake had a mismatch between the channel values. Ensure that you are only submitting exactly the channels you have access to.",
231231+ details: errors,
216232 });
217233218234 // yipee, it's a valid request :3