-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
enhance: 「今日誕生日のユーザー」→「もうすぐ誕生日のユーザー」 #13637
base: develop
Are you sure you want to change the base?
enhance: 「今日誕生日のユーザー」→「もうすぐ誕生日のユーザー」 #13637
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #13637 +/- ##
============================================
- Coverage 77.90% 66.60% -11.31%
============================================
Files 185 1008 +823
Lines 25563 120115 +94552
Branches 487 4631 +4144
============================================
+ Hits 19916 79997 +60081
- Misses 5640 40091 +34451
- Partials 7 27 +20 ☔ View full report in Codecov by Sentry. |
このPRによるapi.jsonの差分 差分はこちら--- base
+++ head
@@ -68051,7 +68051,8 @@
"string",
"null"
],
- "pattern": "^([0-9]{4})-([0-9]{2})-([0-9]{2})$"
+ "pattern": "^([0-9]{4})-([0-9]{2})-([0-9]{2})$",
+ "description": "@deprecated use get-following-birthday-users instead."
}
},
"anyOf": [
@@ -68389,6 +68390,250 @@
}
}
},
+ "/users/get-following-birthday-users": {
+ "post": {
+ "operationId": "users___get-following-birthday-users",
+ "summary": "users/get-following-birthday-users",
+ "description": "Find users who have a birthday on the specified range.\n\n**Credential required**: *Yes* / **Permission**: *read:account*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/users/get-following-birthday-users.ts"
+ },
+ "tags": [
+ "users"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "limit": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 100,
+ "default": 10
+ },
+ "offset": {
+ "type": "integer",
+ "default": 0
+ },
+ "birthday": {
+ "type": "object",
+ "properties": {
+ "month": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 12
+ },
+ "day": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 31
+ },
+ "begin": {
+ "type": "object",
+ "properties": {
+ "month": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 12
+ },
+ "day": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 31
+ }
+ },
+ "required": [
+ "month",
+ "day"
+ ]
+ },
+ "end": {
+ "type": "object",
+ "properties": {
+ "month": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 12
+ },
+ "day": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 31
+ }
+ },
+ "required": [
+ "month",
+ "day"
+ ]
+ }
+ },
+ "anyOf": [
+ {
+ "required": [
+ "month",
+ "day"
+ ]
+ },
+ {
+ "required": [
+ "begin",
+ "end"
+ ]
+ }
+ ]
+ }
+ },
+ "required": [
+ "birthday"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "OK (with results)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "birthday": {
+ "type": "string"
+ },
+ "user": {
+ "type": "object",
+ "$ref": "#/components/schemas/UserLite"
+ }
+ },
+ "required": [
+ "birthday",
+ "user"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INVALID_PARAM": {
+ "value": {
+ "error": {
+ "message": "Invalid param.",
+ "code": "INVALID_PARAM",
+ "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "CREDENTIAL_REQUIRED": {
+ "value": {
+ "error": {
+ "message": "Credential required.",
+ "code": "CREDENTIAL_REQUIRED",
+ "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "AUTHENTICATION_FAILED": {
+ "value": {
+ "error": {
+ "message": "Authentication failed. Please ensure your token is correct.",
+ "code": "AUTHENTICATION_FAILED",
+ "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "418": {
+ "description": "I'm Ai",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "I_AM_AI": {
+ "value": {
+ "error": {
+ "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+ "code": "I_AM_AI",
+ "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INTERNAL_ERROR": {
+ "value": {
+ "error": {
+ "message": "Internal error occurred. Please contact us if the error persists.",
+ "code": "INTERNAL_ERROR",
+ "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/users/get-frequently-replied-users": {
"post": {
"operationId": "users___get-frequently-replied-users",
@@ -72774,6 +73019,10 @@
"null"
],
"description": "The local host is represented with `null`."
+ },
+ "detailed": {
+ "type": "boolean",
+ "default": true
}
},
"anyOf": [
@@ -72806,10 +73055,21 @@
"oneOf": [
{
"type": "object",
+ "$ref": "#/components/schemas/UserLite"
+ },
+ {
+ "type": "object",
"$ref": "#/components/schemas/UserDetailed"
},
{
"type": "array",
+ "items": {
+ "type": "object",
+ "$ref": "#/components/schemas/UserLite"
+ }
+ },
+ {
+ "type": "array",
"items": {
"type": "object",
"$ref": "#/components/schemas/UserDetailed" |
This comment was marked as resolved.
This comment was marked as resolved.
…MisskeyIO#582) (cherry picked from commit fa47a54)
…misskey into enh-bday-widget
This reverts commit a47456c.
ちがった |
API側で出力される誕生日の月が1ヶ月おかしいかも |
javascriptのバグ踏んだ? → なおった ↓ これなら動く // item.birthday_date = 401;
const birthday = new Date();
const monthForDate = Math.floor(item.birthday_date / 100) - 1; // 3
birthday.setMonth(monthForDate, item.birthday_date % 100);
birthday.setHours(0, 0, 0, 0);
if (birthday.getTime() < Date.now()) birthday.setFullYear(new Date().getFullYear() + 1);
const bdayString = birthday.toISOString();
// bdayString = '2024-04-01T15:00:00.000Z' ← OK ↓ こうするとおかしくなる(もとの実装) // item.birthday_date = 401;
const birthday = new Date();
const monthForDate = Math.floor(item.birthday_date / 100) - 1; // 3
birthday.setMonth(monthForDate);
birthday.setDate(item.birthday_date % 100);
birthday.setHours(0, 0, 0, 0);
if (birthday.getTime() < Date.now()) birthday.setFullYear(new Date().getFullYear() + 1);
const bdayString = birthday.toISOString();
// bdayString = '2024-05-01T15:00:00.000Z' ← おかしい |
Co-authored-by: taiy <[email protected]>
(主観的にどうというのは抜きにして)言語仕様のバグではないけど……
|
5d41ee3 で、
という仕様になった(この問題は解消されたはず) ※マジでバグだと思っていたが実装のやり方がまずかっただけらしいことが後でわかった |
月末だけ発生する問題なので、いま発見できて良かった |
packages/backend/src/server/api/endpoints/users/get-following-birthday-users.ts
Show resolved
Hide resolved
フロントエンドいじるだけで対応できそうなので今決められなければ後でやっても問題なさそう |
コンフリクト解消 |
What
Cherry-picked from MisskeyIO@24652b9 MisskeyIO@3858100 MisskeyIO@fa47a54
ioからの変更点
見た目・仕組みはMisskey.ioで稼働しているものからほぼ変更なし
Why
そのほうが圧倒的に便利
Additional info (optional)
users/following
のbirthday
パラメータは削除したChecklist