-
Notifications
You must be signed in to change notification settings - Fork 0
サマリー用通知の転送無視オプション追加 #299
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
Merged
Merged
サマリー用通知の転送無視オプション追加 #299
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
15f4378
サマリー無視設定用Viewの追加
ptkNktq 2a99976
UiState経由でサマリー無視を更新できるに変更
ptkNktq c97ec64
サマリー無視の保存処理追加
ptkNktq 46e3226
修正
ptkNktq 0ab5e7d
db v2のschema追加
ptkNktq 7a4f090
merge develop
ptkNktq 9dea490
v1->2のマイグレーション処理追加
ptkNktq c8c218b
FilterConditionのdefault値追加
ptkNktq 857e51a
微修正
ptkNktq 5540f6d
サマリー無視のデフォルト値をfalseに変更
ptkNktq d5060bd
通知の転送時にサマリー無視の設定を反映するように修正
ptkNktq 7265ec5
LoadFilterConditionUseCaseの返り値をFilterConditionに変更
ptkNktq 8e1e5a7
通知条件のテスト修正
ptkNktq 9c10444
バックアップのテスト修正
ptkNktq 95b7db7
サマリー無視の設定をテストに追加
ptkNktq e88c5ea
翻訳ファイル追加
ptkNktq File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...pp/data/repository/schemas/me.nya_n.notificationnotifier.data.repository.source.DB/2.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| { | ||
| "formatVersion": 1, | ||
| "database": { | ||
| "version": 2, | ||
| "identityHash": "85b4a3de210e1ef5dfec5df608f693db", | ||
| "entities": [ | ||
| { | ||
| "tableName": "conditions", | ||
| "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`target_package_name` TEXT NOT NULL, `is_ignore_summary` INTEGER NOT NULL DEFAULT 0, `condition` TEXT NOT NULL, PRIMARY KEY(`target_package_name`))", | ||
| "fields": [ | ||
| { | ||
| "fieldPath": "targetPackageName", | ||
| "columnName": "target_package_name", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "isIgnoreSummary", | ||
| "columnName": "is_ignore_summary", | ||
| "affinity": "INTEGER", | ||
| "notNull": true, | ||
| "defaultValue": "0" | ||
| }, | ||
| { | ||
| "fieldPath": "condition", | ||
| "columnName": "condition", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| } | ||
| ], | ||
| "primaryKey": { | ||
| "autoGenerate": false, | ||
| "columnNames": [ | ||
| "target_package_name" | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "tableName": "targets", | ||
| "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`label` TEXT NOT NULL, `package_name` TEXT NOT NULL, PRIMARY KEY(`package_name`))", | ||
| "fields": [ | ||
| { | ||
| "fieldPath": "label", | ||
| "columnName": "label", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "packageName", | ||
| "columnName": "package_name", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| } | ||
| ], | ||
| "primaryKey": { | ||
| "autoGenerate": false, | ||
| "columnNames": [ | ||
| "package_name" | ||
| ] | ||
| } | ||
| } | ||
| ], | ||
| "setupQueries": [ | ||
| "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", | ||
| "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '85b4a3de210e1ef5dfec5df608f693db')" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...rc/main/kotlin/me/nya_n/notificationnotifier/domain/usecase/LoadFilterConditionUseCase.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| package me.nya_n.notificationnotifier.domain.usecase | ||
|
|
||
| import me.nya_n.notificationnotifier.model.FilterCondition | ||
| import me.nya_n.notificationnotifier.model.InstalledApp | ||
|
|
||
| /** 通知条件を読み込む */ | ||
| interface LoadFilterConditionUseCase { | ||
| suspend operator fun invoke(target: InstalledApp): String | ||
| suspend operator fun invoke(target: InstalledApp): FilterCondition | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...rc/main/kotlin/me/nya_n/notificationnotifier/domain/usecase/ToggleIgnoreSummaryUseCase.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package me.nya_n.notificationnotifier.domain.usecase | ||
|
|
||
| import me.nya_n.notificationnotifier.model.InstalledApp | ||
|
|
||
| interface ToggleIgnoreSummaryUseCase { | ||
| suspend fun invoke(args: Args): Boolean | ||
|
|
||
| data class Args(val target: InstalledApp) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
無効な正規表現パターンによる例外処理を検討してください。
Regex(pattern = cond.condition)は、ユーザーが無効な正規表現を入力した場合にPatternSyntaxExceptionをスローします。runCatchingでキャッチされますが、Result.failureが返却されるため、通知が失敗扱いになります。また、
matches()は文字列全体がパターンに一致する必要があります。部分一致を期待している場合はcontainsMatchIn()の使用を検討してください。🔧 例外ハンドリングと部分一致の提案
if (cond.condition.isNotEmpty()) { - val regex = Regex(pattern = cond.condition) - if (!regex.matches("$title $message")) { - return Result.success(Unit) + val regex = runCatching { Regex(pattern = cond.condition) }.getOrNull() + if (regex != null && !regex.containsMatchIn("$title $message")) { + return Result.success(Unit) } }📝 Committable suggestion
🤖 Prompt for AI Agents