Skip to content

Commit

Permalink
Merge pull request #64 from cmushroom/dev
Browse files Browse the repository at this point in the history
3.0.0
  • Loading branch information
chengpan168 committed Sep 10, 2023
2 parents 477713e + f4e2fd3 commit 74d1037
Show file tree
Hide file tree
Showing 91 changed files with 4,751 additions and 4,409 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions .version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"latestVersionNum": 22,
"latestVersion": "2.5.2",
"latestVersionNum": 30,
"latestVersion": "3.0.0",
"updateType": "hint",
"releaseNotes": "1. 增加字符串长度查询设置,对于超长字符通守getrange改善性能。\n2. 优化线程池关闭方式。"
"releaseNotes": "1. 升级TCA,使用Reducer重写store 部分。\n2. 增加快速分页模式, 在查询结果数据量较大情况时,优化查询性能。"
}
13 changes: 11 additions & 2 deletions Q&A.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# 问题记录

1. tca 监听不存在的属值时, 会造成编译卡死, swift-frontend 内存泄漏

## TCA
1. tca 监听不存在的属性值时, 会造成编译卡死, swift-frontend 内存泄漏
2. 同一个reducer被注入多次时, action方法会被多次调用,例如:
```
Scope(state: \.redisKeysState, action: /Action.redisKeysAction) {
RedisKeysStore(redisInstanceModel: redisInstanceModel)
}
Scope(state: \.redisKeysState, action: /Action.redisKeysAction) {
RedisKeysStore(redisInstanceModel: redisInstanceModel)
}
```
4 changes: 3 additions & 1 deletion Tests/RedisBaseTests/RedisClientBaseTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ import Logging
open class RedisClientBaseTest: RedisBaseTest {
let logger = Logger(label: "redis-client-test")

var redisModel: RedisModel!
var redisClient: RediStackClient!

open override func setUp() {
logger.info("redis client base test setUp...")
redisClient = .init(RedisModel(host: redisHostname, port: redisPort, username: redisUsername, password: redisPassword))
self.redisModel = RedisModel(host: redisHostname, port: redisPort, username: redisUsername, password: redisPassword)
redisClient = .init(redisModel)
// let conn = try await redisClient.initConn(host: redisHostname, port: redisPort, username: redisUsername ?? "", pass: redisPassword ?? "", database: 0)
}

Expand Down
28 changes: 28 additions & 0 deletions Tests/Store/AppContextStoreTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// AppContextStoreTests.swift
// Tests
//
// Created by chengpan on 2023/8/5.
//

@testable import redis_pro
import Foundation
import XCTest
import ComposableArchitecture

@MainActor
class AppContextStoreTests: StoreBaseTests {
func testShow() async {
let store = TestStore(initialState: AppContextStore.State()) {
AppContextStore()
} withDependencies: {
$0.redisInstance = redisInstance
$0.redisClient = redisClient
}

await store.send(.show) {
$0.loading = true
$0.loadingCount = 1
}
}
}
27 changes: 27 additions & 0 deletions Tests/Store/KeysDelStoreTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// AppStoreTest.swift
// Tests
//
// Created by chengpan on 2023/8/5.
//

@testable import redis_pro
import Foundation
import XCTest
import ComposableArchitecture

@MainActor
class KeysDelStoreTests: StoreBaseTests {
func testBasics() async {
let store = TestStore(initialState: KeysDelStore.State()) {
KeysDelStore()
} withDependencies: {
$0.redisInstance = redisInstance
$0.redisClient = redisClient
}

// await store.send(.favoriteAction(.connectSuccess(self.redisModel))) {
// $0.isConnect = true
// }
}
}
28 changes: 28 additions & 0 deletions Tests/Store/StoreBaseTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// StoreBaseTests.swift
// Tests
//
// Created by chengpan on 2023/8/5.
//

@testable import redis_pro
import Foundation
import Logging
import XCTest
import ComposableArchitecture


class StoreBaseTests: RedisClientBaseTest {
var redisInstance: RedisInstanceModel!

override func setUp() {
super.setUp()
self.redisInstance = RedisInstanceModel(redisModel: redisModel)
logger.info("StoreBaseTests setup...")
}


func testExample() {
logger.info("test example ...")
}
}
156 changes: 93 additions & 63 deletions redis-pro.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/microsoft/appcenter-sdk-apple.git",
"state" : {
"revision" : "88e65475ffd3a7cf2bbde07df9e62159a1fd60a8",
"version" : "5.0.0"
"revision" : "5756ddb0f09041e91bdb3b73c17296ac005ad11a",
"version" : "5.0.3"
}
},
{
"identity" : "combine-schedulers",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/combine-schedulers",
"state" : {
"revision" : "4cf088c29a20f52be0f2ca54992b492c54e0076b",
"version" : "0.5.3"
"revision" : "9dc9cbe4bc45c65164fa653a563d8d8db61b09bb",
"version" : "1.0.0"
}
},
{
Expand Down Expand Up @@ -50,17 +50,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-atomics",
"state" : {
"revision" : "919eb1d83e02121cdb434c7bfc1f0c66ef17febe",
"version" : "1.0.2"
"revision" : "6c89474e62719ddcc1e9614989fff2f68208fe10",
"version" : "1.1.0"
}
},
{
"identity" : "swift-case-paths",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-case-paths",
"state" : {
"revision" : "ce9c0d897db8a840c39de64caaa9b60119cf4be8",
"version" : "0.8.1"
"revision" : "5da6989aae464f324eef5c5b52bdb7974725ab81",
"version" : "1.0.0"
}
},
{
"identity" : "swift-clocks",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-clocks",
"state" : {
"revision" : "d1fd837326aa719bee979bdde1f53cd5797443eb",
"version" : "1.0.0"
}
},
{
Expand All @@ -77,8 +86,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-composable-architecture",
"state" : {
"branch" : "main",
"revision" : "007c857bde0410b9d214d7f1e7659551553e337a"
"revision" : "a7c1f799b55ecb418f85094b142565834f7ee7c7",
"version" : "1.2.0"
}
},
{
"identity" : "swift-concurrency-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
"state" : {
"revision" : "ea631ce892687f5432a833312292b80db238186a",
"version" : "1.0.0"
}
},
{
Expand All @@ -95,17 +113,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-custom-dump",
"state" : {
"revision" : "51698ece74ecf31959d3fa81733f0a5363ef1b4e",
"version" : "0.3.0"
"revision" : "edd66cace818e1b1c6f1b3349bb1d8e00d6f8b01",
"version" : "1.0.0"
}
},
{
"identity" : "swift-dependencies",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-dependencies",
"state" : {
"revision" : "4e1eb6e28afe723286d8cc60611237ffbddba7c5",
"version" : "1.0.0"
}
},
{
"identity" : "swift-identified-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-identified-collections",
"state" : {
"revision" : "680bf440178a78a627b1c2c64c0855f6523ad5b9",
"version" : "0.3.2"
"revision" : "d1e45f3e1eee2c9193f5369fa9d70a6ddad635e8",
"version" : "1.0.0"
}
},
{
Expand All @@ -122,35 +149,44 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-metrics.git",
"state" : {
"revision" : "53be78637ecd165d1ddedc4e20de69b8f43ec3b7",
"version" : "2.3.2"
"revision" : "971ba26378ab69c43737ee7ba967a896cb74c0d1",
"version" : "2.4.1"
}
},
{
"identity" : "swift-nio",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "e855380cb5234e96b760d93e0bfdc403e381e928",
"version" : "2.45.0"
"revision" : "a2e487b77f17edbce9a65f2b7415f2f479dc8e48",
"version" : "2.57.0"
}
},
{
"identity" : "swift-nio-ssh",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-ssh",
"state" : {
"revision" : "baa05dc6ff3de89c589a9d582659f0f6699f62ab",
"version" : "0.6.1"
"revision" : "ded5e5ce4ef1b2c29933088651fa66c89e2175d2",
"version" : "0.8.0"
}
},
{
"identity" : "swift-service-discovery",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-service-discovery",
"state" : {
"revision" : "c83afedb1c95ef0111907cd6e2fd03d7175cc0d0",
"version" : "1.2.0"
"revision" : "5c88b88dd40446740e86ba809453bc39f7904fa7",
"version" : "1.2.1"
}
},
{
"identity" : "swiftui-navigation",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swiftui-navigation",
"state" : {
"revision" : "905274b2bd98be556d2cfcf31b94d5979b924755",
"version" : "1.0.1"
}
},
{
Expand All @@ -167,8 +203,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state" : {
"revision" : "50a70a9d3583fe228ce672e8923010c8df2deddd",
"version" : "0.2.1"
"revision" : "23cbf2294e350076ea4dbd7d5d047c1e76b03631",
"version" : "1.0.2"
}
}
],
Expand Down
Binary file not shown.
Loading

0 comments on commit 74d1037

Please sign in to comment.