-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.0.0 #307
Conversation
Added: NO, FAILED, NOT_ALLOWED Removed: MUST_BE_ADMIN
This reverts commit 29d6610.
Also fixed a few bugs, and made the state of the server quick switcher (ServerList) persist over reloads.
packages/client/js/storage.js
Outdated
const str = storage.getItem(key) | ||
const value = str ? JSON.parse(str) : defaultValue | ||
|
||
console.log(`Storage: loaded ${key} =`, value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't keep these logs in the final 1.0.0!
Before I forget
Just a couple mostly-dummy endpoints for now (and no tests). Still want to do some needed work for permissions on the other endpoints first.
const { channel } = request[middleware.vars] | ||
} | ||
]) | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
um
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIP, of course.
} catch (error) { | ||
t.is(error.code, 'NOT_ALLOWED') | ||
t.is(error.missingPermission, 'sendSystemMessages') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heyitsmeuralex You still need to update serialize.message
, and you should update test/serialize.js
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit and a question re: flair test. System messages look good otherwise!
packages/server/serialize.js
Outdated
authorAvatarURL: emailToAvatarURL(m.authorEmail || m.authorID), | ||
authorUsername: m.type === 'system' ? null : m.authorUsername, | ||
authorID: m.type === 'system' ? null : m.authorID, | ||
authorAvatarURL: m.type === 'system' ? null : emailToAvatarURL(m.authorEmail || m.authorID), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably be doing these the other way around -- m.type === 'user' ? m.authorUsername : null
, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we ever add more types they'll likely be tied to users too - system
is the special case, not user
.
t.is(serialized.id, '123') | ||
t.is(serialized.authorUsername, 'jen') | ||
t.is(serialized.authorID, '234') | ||
t.is(serialized.authorFlair, 'spooks') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, okay. Now I'm honestly surprised - was this test broken? It was passing, but it seems like t.deepEqual
should have failed, since serialize.message
doesn't have anything to handle authorFlair
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed authorFlair
in the previous commit and forgot to test serialization - I don't think it was a broken test :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay! Sounds good.
Ready to merge as soon as https://github.com/decent-chat/decent/projects/7 is fully complete :)
Resolves #115
Fixes #234
Fixes #261
Fixes #276
Fixes #281
Fixes #305