Skip to content
  • 0 Votes
    19 Posts
    1 Views
    S
    @Julian I filtered out the null names and the upgrade went through: "use strict"; const db = require("../../database"); const meta = require("../../meta"); const categories = require("../../categories"); const slugify = require("../../slugify"); module.exports = { name: "Setting up default configs/privileges re: ActivityPub", timestamp: Date.UTC(2024, 1, 22), method: async () => { // Disable ActivityPub (upgraded installs have to opt-in to AP) meta.configs.set("activitypubEnabled", 0); // Set default privileges for world category const install = require("../../install"); await install.giveWorldPrivileges(); // Run through all categories and ensure their slugs are unique (incl. users/groups too) const cids = await db.getSortedSetMembers("categories:cid"); const names = await db.getObjectsFields( cids.map((cid) => `category:${cid}`), cids.map(() => "name"), ); const nullIndexes = names .map((element, index) => (element["name"] === null ? index : -1)) // mark null elements .filter((index) => index !== -1); let filteredNames = names.filter(element => element["name"] !== null); let filteredCids = cids.filter((_, index) => !nullIndexes.includes(index)); const handles = await Promise.all( filteredCids.map(async (cid, idx) => { const { name } = filteredNames[idx]; const handle = await categories.generateHandle(slugify(name)); return handle; }), ); await Promise.all([ db.setObjectBulk( filteredCids.map((cid, idx) => [`category:${cid}`, { handle: handles[idx] }]), ), db.sortedSetAdd("categoryhandle:cid", filteredCids, handles), ]); }, };
  • 0 Votes
    1 Posts
    6 Views
    No one has replied
  • 0 Votes
    22 Posts
    60 Views
    oplik0@community.nodebb.orgO
    @pfefferle@mastodon.social it was actually because of @ in actor IDs - the codepath for choosing a webfinger lookup over just accepting the URL as the ID only checked for its presence, and the code for webfinger lookups was only meant to run for the acct: protocol. So yeah, not WP fault at all, just a combination of a bug and missing feature Now both should be fixed.
  • Test topic with tags

    General Discussion
    3
    0 Votes
    3 Posts
    57 Views
    devnull@crag.socialD
    @julian Here's a response from Mastodon