Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
be7985d
Let Rotur orgs own projects and spaces in place of Rotur groups
Mistium Nov 27, 2026
60ff2b8
Org publishers manage org-owned projects as owners
Mistium Nov 27, 2026
04ce631
Tie org content to the org's id, fan out its notifications and treat …
Mistium Nov 27, 2026
75d7f0a
Let org publishers recover, moderate and collaborate on org content, …
Mistium Nov 27, 2026
66a7129
Treat org publishers as entry owners, refuse moves to orgs Rotur can'…
Mistium Nov 27, 2026
3ee8752
Keep org projects off same-named personal accounts, count the submitt…
Mistium Nov 27, 2026
2ab716f
Only org admins move content out of an org, count org project limits …
Mistium Nov 28, 2026
c1ee79a
Erase an org's own spaces with it, share one Rotur org lookup between…
Mistium Nov 28, 2026
e24cdf1
Look orgs up by id so renames keep access, check the viewer's own org…
Mistium Nov 28, 2026
3a035f4
Keep live broadcasts off Rotur by reading cached org snapshots, and c…
Mistium Nov 28, 2026
fba4673
Check team and remix-share access through update lookups, wait for Ro…
Mistium Nov 28, 2026
3490bf0
Check org access before taking the project save lock, cap org notific…
Mistium Nov 28, 2026
9097fb7
Keep unlisted org spaces off the public org page, keep private publis…
Mistium Nov 28, 2026
c0b746d
Key private org project thumbnails for publishers on the org page and…
Mistium Nov 28, 2026
7faf2c5
Judge own-work guards and the trash listing by org publishing, not si…
Mistium Nov 28, 2026
05cdc0b
Warm remix ancestors and org snapshots before the save lock, skip the…
Mistium Nov 28, 2026
5bb61de
Keep only listed judges' scores in breakdowns for curators outside th…
Mistium Nov 28, 2026
35046be
Warm org access before the remix save lock, write challenge scores, v…
Mistium Nov 28, 2026
cf2e883
Recheck the judge and criteria under the space lock, answer 503 to or…
Mistium Nov 28, 2026
fc42be5
Join and leave challenges under the space lock after the Rotur checks…
Mistium Nov 28, 2026
d9eeecd
Remove space projects under the space lock after the Rotur checks, an…
Mistium Nov 28, 2026
7eda423
Refuse space edits when the space is gone or criteria would change af…
Mistium Nov 28, 2026
5eb17eb
Apply only the changed fields of a space edit onto the locked re-read…
Mistium Nov 28, 2026
97c3428
Compare effective voting modes when saving an edit, and invite, remov…
Mistium Nov 28, 2026
a48aa35
Recheck curator authority under the space lock, read org snapshots fr…
Mistium Nov 28, 2026
50156b6
Require ownership when a removed curator's add falls back to particip…
Mistium Nov 28, 2026
7334ab1
Count comments, follow spaces and set studio thumbnails under the spa…
Mistium Nov 28, 2026
e793e56
Return the saved studio thumbnail url and smoke test studio thumbnails
Mistium Nov 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion opal.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mistwarp-api",
"version": "1.7.0",
"version": "2.0.0",
"main": "main.osl",
"scripts": {
"dev": ["osl", "run", "main.osl"],
Expand Down
170 changes: 162 additions & 8 deletions scripts/e2e_smoke.py

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/admin/errors.osl
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ array siteErrorPathWords = [
"about", "account-frame.html", "addon-settings.html", "addons", "admin", "assignments", "bounties", "changes",
"claim", "classroom", "commits", "compare", "dpa", "editor", "editor.html", "embed", "embed.html", "entry",
"explore", "followers", "following", "fullscreen", "fullscreen.html", "groups", "index.html", "join",
"leaderboard", "library", "manage", "mystuff", "news", "notifications", "p", "perks", "player", "player.html",
"leaderboard", "library", "manage", "mystuff", "news", "notifications", "orgs", "p", "perks", "player", "player.html",
"posts", "privacy", "project", "pulls", "purchases", "random", "remixes", "roadmap", "school", "search",
"settings", "simple.html", "spaces", "stats", "status", "students", "subprocessors", "support", "terms",
"themes", "trust", "users", "wallet"
]

array siteErrorIdParents = [
"assignments", "bounties", "claim", "commits", "entry", "groups", "join", "news", "p", "posts", "project",
"assignments", "bounties", "claim", "commits", "entry", "groups", "join", "news", "orgs", "p", "posts", "project",
"pulls", "spaces", "students", "themes", "users"
]

Expand Down Expand Up @@ -61,7 +61,7 @@ def siteErrorText(string text, string pageUrl, string scrubbedUrl) string (
value = regex.replace(regex.escape(page) ++ "([^A-Za-z0-9._~%/-]|$)", value, scrubbedUrl ++ "$1")
)
value = regex.replace("(https?://[^[:space:]?#()<>\"']+)[?#][^[:space:]()<>\"']*?((:[0-9]+){1,2})?([[:space:])<>\"']|$)", value, "$1$2$4")
value = regex.replace("(?i)(https?://([a-z0-9-]+[.])*mistwarp[.]org)/(p|project|users|spaces|groups|bounties|news|posts|themes|claim|join)/[^/?#[:space:]:()<>\"']+", value, "$1/$3/:id")
value = regex.replace("(?i)(https?://([a-z0-9-]+[.])*mistwarp[.]org)/(p|project|users|orgs|spaces|groups|bounties|news|posts|themes|claim|join)/[^/?#[:space:]:()<>\"']+", value, "$1/$3/:id")
value = regex.replace("(?i)(https?://editor[.]mistwarp[.]org)/[0-9]+", value, "$1/:id")
value = regex.replace("(https?://avatars[.]rotur[.]dev)/[^/?#[:space:]:()<>\"']+", value, "$1/:id")
value = regex.replace("(?i)/(users|blocks|mutes|followers|following|curators|invitations|judges|profiles?|projects|classes|students|teachers|claim|join|vanity|game-saves|library)/[^/?#[:space:]:()<>\"']+", value, "/$1/:id")
Expand Down
4 changes: 2 additions & 2 deletions src/admin/project-moderation.osl
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def hideProjectForModeration(object project, string reason, string actor) (
ownerProfile.featuredProject = ""
saveProfile(ownerProfile)
)
addNotification(project.owner.toStr(), actor, "project_hidden", {projectId: project.id, projectTitle: project.title, reason: reason})
notifyContentOwner(project, actor, "project_hidden", {projectId: project.id, projectTitle: project.title, reason: reason})
)

def handleRestoreHiddenProject(*serve.Context c) (
Expand Down Expand Up @@ -383,6 +383,6 @@ def handleRestoreHiddenProject(*serve.Context c) (
)
saveProject(project)
upsertIndexEntry(project)
addNotification(project.owner.toStr(), contextString(c, "username"), "project_restored", {projectId: project.id, projectTitle: project.title, visibility: visibility})
notifyContentOwner(project, contextString(c, "username"), "project_restored", {projectId: project.id, projectTitle: project.title, visibility: visibility})
c.json(200, {ok: true, project: projectResponse(project, c)})
)
2 changes: 1 addition & 1 deletion src/auth/account-controls.osl
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def eraseUser(string userId, string username) (
for i ownedProjectIds.len (
deleteProjectCommunityRecords(ownedProjectIds[i].toStr())
)
purgeUserFromSpaces(username)
purgeUserFromSpaces(username, userId)
removeProjectsFromSpaces(ownedProjectIds)
purgeUserCommunityRecords(username, userId)
purgeUserFromNews(username)
Expand Down
15 changes: 10 additions & 5 deletions src/auth/user-identity.osl
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def renameUserInProjects(string oldKey, string newKey, string newName, string us
if res.ok (
object project = res.project.assert(object)
boolean changed = false
if normalizeUsername(project.owner.toStr()) == oldKey (
if normalizeUsername(project.owner.toStr()) == oldKey and !ownedByAnotherOrg(project, userId) (
project.owner = newName
project.ownerId = userId
changed = true
Expand Down Expand Up @@ -212,11 +212,16 @@ def renameUserInProjects(string oldKey, string newKey, string newName, string us
)
)

def ownedByAnotherOrg(object record, string userId) boolean (
string ownerId = (record.ownerId ?? "").toStr()
return (record.ownerType ?? "").toStr() == "org" and ownerId != "" and ownerId != userId
)

def renameIdentityFieldInCollection(*db.Collection collection, string nameField, string idField, string oldKey, string newName, string userId) (
array documents = collection.all()
for i documents.len (
object document = documents[i].assert(object)
if document.contains(nameField) and document[nameField] != null and normalizeUsername(document[nameField].toStr()) == oldKey (
if document.contains(nameField) and document[nameField] != null and normalizeUsername(document[nameField].toStr()) == oldKey and !ownedByAnotherOrg(document, userId) (
document[nameField] = newName
document[idField] = userId
putDocument(collection, document["_id"].toStr(), document)
Expand Down Expand Up @@ -464,7 +469,7 @@ def backfillOwnerIdForUserProjects(string userId, string username) (
array matches = projectSearchDocs.where("ownerKey", "==", ownerKey).all()
for i matches.len (
object entry = matches[i].assert(object)
if (entry.ownerId ?? "").toStr() != userId (
if (entry.ownerType ?? "").toStr() != "org" and (entry.ownerId ?? "").toStr() != userId (
entry.ownerId = userId
putDocument(projectSearchDocs, entry["_id"].toStr(), entry)
auto loaded = loadProject(entry.id.toStr())
Expand Down Expand Up @@ -578,7 +583,7 @@ def discoverUserIdentityOutcome(string username) object (
)
ensureUserIdentity(userId, currentUsername)
identityRefreshCache.set(userId, currentUsername)
return {id: userId, outcome: "found"}
return {id: userId, outcome: "found", accountType: (profile.account_type ?? "").toStr()}
)

def usernameForId(string userId) string (
Expand Down Expand Up @@ -815,7 +820,7 @@ def purgeUser(string userId, string username) (
purgeUserFromNotifications(key)
purgeGameDataForUser(userId)
purgeBackpackForUser(userId)
purgeUserFromSpaces(username)
purgeUserFromSpaces(username, userId)
purgeUserCommunityRecords(username, userId)
purgeUserFromNews(username)
removeUserFromSafetyLists(username)
Expand Down
2 changes: 1 addition & 1 deletion src/classroom/classroom-release.osl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def handleGetClaim(*serve.Context c) (
def moveProjectOwner(object project, string username, string userId) (
project.owner = username
project.ownerId = userId
project.groupTag = ""
project.ownerType = ""
project.edited = timestamp
saveProject(project)
upsertIndexEntry(project)
Expand Down
2 changes: 1 addition & 1 deletion src/classroom/classrooms.osl
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ def createBlankStudentProject(object student, string title) object (
id: id,
owner: student.username,
ownerId: student["_id"],
groupTag: "",
ownerType: "",
branding: {},
vanitySlug: "",
title: title,
Expand Down
Loading
Loading