mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
test: more logs for failing test
This commit is contained in:
@@ -34,25 +34,27 @@ function reject(type, object, target, senderType = 'uid', id = 0) {
|
|||||||
|
|
||||||
inbox.create = async (req) => {
|
inbox.create = async (req) => {
|
||||||
const { object, actor } = req.body;
|
const { object, actor } = req.body;
|
||||||
|
const start = Date.now();
|
||||||
// Alternative logic for non-public objects
|
// Alternative logic for non-public objects
|
||||||
const isPublic = [...(object.to || []), ...(object.cc || [])].includes(activitypub._constants.publicAddress);
|
const isPublic = [...(object.to || []), ...(object.cc || [])].includes(activitypub._constants.publicAddress);
|
||||||
if (!isPublic) {
|
if (!isPublic) {
|
||||||
return await activitypub.notes.assertPrivate(object);
|
return await activitypub.notes.assertPrivate(object);
|
||||||
}
|
}
|
||||||
|
console.log(' 4a', Date.now() - start);
|
||||||
// Category sync, remove when cross-posting available
|
// Category sync, remove when cross-posting available
|
||||||
const { cids } = await activitypub.actors.getLocalFollowers(actor);
|
const { cids } = await activitypub.actors.getLocalFollowers(actor);
|
||||||
let cid = null;
|
let cid = null;
|
||||||
if (cids.size > 0) {
|
if (cids.size > 0) {
|
||||||
cid = Array.from(cids)[0];
|
cid = Array.from(cids)[0];
|
||||||
}
|
}
|
||||||
|
console.log(' 4b', Date.now() - start);
|
||||||
const asserted = await activitypub.notes.assert(0, object, { cid });
|
const asserted = await activitypub.notes.assert(0, object, { cid });
|
||||||
|
console.log(' 4c', Date.now() - start);
|
||||||
if (asserted) {
|
if (asserted) {
|
||||||
await activitypub.feps.announce(object.id, req.body);
|
await activitypub.feps.announce(object.id, req.body);
|
||||||
// api.activitypub.add(req, { pid: object.id });
|
// api.activitypub.add(req, { pid: object.id });
|
||||||
}
|
}
|
||||||
|
console.log(' 4d', Date.now() - start);
|
||||||
};
|
};
|
||||||
|
|
||||||
inbox.add = async (req) => {
|
inbox.add = async (req) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user