Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d42ddbd
feat: update js to 2.9.0 and fix compatibility issues
jk234ert Jun 29, 2022
28fb9b6
chore: update podfile with 1.6.0 walletconnect
Jun 30, 2022
82a301a
fix: crash caused by handling ClientDelegate in other threads
Jun 30, 2022
af51baf
Merge branch 'develop' into feat/updateJS20220627
Jun 30, 2022
15ea660
Merge branch 'develop' into feat/updateJS20220627
Jul 6, 2022
22fb07e
Merge branch 'develop' into feat/updateJS20220627
Jul 8, 2022
82f0a6b
Merge branch 'develop' into feat/updateJS20220627
foxsin10 Jul 11, 2022
430e189
feat: bump macOS version to 12
foxsin10 Jul 11, 2022
a83631e
feat: use xcode 13.3
foxsin10 Jul 11, 2022
f56cee6
chore: refine deploy yaml
foxsin10 Jul 11, 2022
7fca236
feat: remove code sign for `CoreDataStack`
foxsin10 Jul 11, 2022
cdf2781
Merge branch 'develop' into chore/ci-2.9.0
foxsin10 Jul 12, 2022
5dfa530
feat: stop building iOS and cache pods
foxsin10 Jul 12, 2022
6b315f2
feat: reserve deploy workflow
foxsin10 Jul 12, 2022
e837365
feat: skip pod install if cache hit
foxsin10 Jul 12, 2022
f8e1460
feat: bump xcode version to 13.4.1 to fix compiler error
foxsin10 Jul 12, 2022
4c54eb8
feat: bump `Alamofire` to `5.4.4`
foxsin10 Jul 12, 2022
1729786
feat: bump pod file to platform `iOS 14.0`
foxsin10 Jul 12, 2022
9032f56
Merge branch 'develop' into release/2.9.0
foxsin10 Jul 12, 2022
a856bf8
feat: use fix version for pod dependencies
foxsin10 Jul 12, 2022
f260527
Merge branch 'develop' into release/2.9.0
foxsin10 Jul 12, 2022
5ecf5b5
Merge branch 'develop' into release/2.9.0
foxsin10 Jul 14, 2022
7ce5423
Merge branch 'develop' into release/2.9.0
foxsin10 Jul 15, 2022
b3d6c84
Merge branch 'develop' into release/2.9.0
foxsin10 Jul 15, 2022
d8bfb89
feat: support file service parsing in backup file
foxsin10 Jul 13, 2022
f255456
feat: support back up preview including native file service file
foxsin10 Jul 13, 2022
d3c9ae6
feat: add file service info into backup file
foxsin10 Jul 14, 2022
17a2f34
feat: add file mime type adoption
foxsin10 Jul 14, 2022
180ed50
chore: update comment
foxsin10 Jul 15, 2022
f485c93
refactor: remove type infer
foxsin10 Jul 15, 2022
0e0eaf3
fix: mm-743
foxsin10 Jul 18, 2022
b9b5c1e
Merge branch 'develop' into release/2.9.0
Jul 19, 2022
99f7fb8
Fix/redpacket gas (#232)
cythb Jul 25, 2022
a1ae503
Merge branch 'develop' into release/2.9.0
foxsin10 Jul 25, 2022
87fbabe
fix: mm-762, mm-763
foxsin10 Jul 21, 2022
a78b590
feat: update `UploadFile`
foxsin10 Jul 22, 2022
47438c5
refactor: refine `RestorFile` parsing
foxsin10 Jul 25, 2022
35115c7
fix: mm-768, mm-770
foxsin10 Jul 25, 2022
a0a946f
refactor: add comment for use `Dispatch`
foxsin10 Jul 25, 2022
6580879
fix: do not pass mime, use computed property to get mime
sxiaojian88 Jul 25, 2022
08f7df5
Refactor/refine `restore file` parsing (#237)
foxsin10 Jul 25, 2022
09c2f87
fix: use cdn to download arweave
sxiaojian88 Jul 25, 2022
746c422
fix: try cdn adjudgement
sxiaojian88 Jul 25, 2022
4806f65
fix: combine file content, upload option and file name to make unique…
foxsin10 Jul 28, 2022
ebe4165
refactor: use `id`, `landingTxID`, `payloadTxID`, `meson` and `encryp…
foxsin10 Jul 29, 2022
8d3f0de
fix: fix coredata compiler error caused by typo
foxsin10 Jul 29, 2022
0deda82
fix: adjust text aliginment to center
foxsin10 Aug 9, 2022
69b7bd8
fix(mm-727): process of password checking (#256)
cythb Aug 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 15 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ on:

jobs:
deploy:
runs-on: macos-latest
runs-on: macos-12
steps:
- uses: actions/checkout@v2

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'

- name: Set up ruby env
uses: ruby/setup-ruby@v1
with:
Expand All @@ -29,7 +33,17 @@ jobs:
with:
version: latest

- name: Cache Pods
id: cache-pods
uses: actions/cache@v3
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-

- name: Install Dependencies
if: steps.cache-pods.outputs.cache-hit != 'true'
run: pod install --repo-update

- name: Restore Secrets
Expand Down
6 changes: 3 additions & 3 deletions CoreDataStack/Entity/UploadFile+CoreDataProperties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ extension UploadFile {
return NSFetchRequest<UploadFile>(entityName: "UploadFile")
}

@NSManaged public var content: Data?
@NSManaged public var createdAt: Date?
@NSManaged public var fileSize: Double
@NSManaged public var fileType: Int64
@NSManaged public var id: String?
@NSManaged public var key: String?
@NSManaged public var landingTxID: String?
@NSManaged public var mime: String?
@NSManaged public var name: String?
@NSManaged public var payloadTxID: String?
@NSManaged public var provider: String?
@NSManaged public var uploadOption: String?
@NSManaged public var content: Data?
@NSManaged public var encrypted: String?
@NSManaged public var meson: String?

}

Expand Down
91 changes: 78 additions & 13 deletions CoreDataStack/Extension/Predicate.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation

public final class Predicate<S> : NSCompoundPredicate {

public final class Predicate<S>: NSCompoundPredicate {
fileprivate init(from predicate: NSPredicate) {
super.init(type: .and, subpredicates: [predicate])
}
Expand All @@ -9,18 +10,82 @@ public final class Predicate<S> : NSCompoundPredicate {
super.init(type: type, subpredicates: subpredicates)
}

required public init?(coder: NSCoder) {
@available(*, unavailable)
public required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}

public func == <S, E: Equatable>(lhs: KeyPath<S,E>, rhs: E) -> Predicate<S> {
/// Only use for NSManagedObject as we use NSExpression to make it work
/// stable Types: Date, String, Int
/// optional work types: Date, String

public func == <S, E: Equatable>(lhs: KeyPath<S, E>, rhs: E) -> Predicate<S> {
let predicate = NSComparisonPredicate(
leftExpression: NSExpression(forKeyPath: lhs),
rightExpression: NSExpression(forConstantValue: rhs),
modifier: .direct,
type: .equalTo,
options: []
)

return Predicate<S>(from: predicate)
}

public func == <S, E: Equatable>(lhs: KeyPath<S, E?>, rhs: E?) -> Predicate<S> {
let predicate = NSComparisonPredicate(
leftExpression: NSExpression(forKeyPath: lhs),
rightExpression: NSExpression(forConstantValue: rhs),
modifier: .direct,
type: .equalTo,
options: [])

return Predicate<S>(from: predicate)
}

public func != <S, E: Equatable>(lhs: KeyPath<S, E>, rhs: E) -> Predicate<S> {
let predicate = NSComparisonPredicate(
leftExpression: NSExpression(forKeyPath: lhs),
rightExpression: NSExpression(forConstantValue: rhs),
modifier: .direct,
type: .notEqualTo,
options: []
)

return Predicate<S>(from: predicate)
}

public func != <S, E: Equatable>(lhs: KeyPath<S, E?>, rhs: E?) -> Predicate<S> {
let predicate = NSComparisonPredicate(
leftExpression: NSExpression(forKeyPath: lhs),
rightExpression: NSExpression(forConstantValue: rhs),
modifier: .direct,
type: .notEqualTo,
options: []
)

return Predicate<S>(from: predicate)
}

public func > <S, C: Comparable>(lhs: KeyPath<S, C>, rhs: C) -> Predicate<S> {
let predicate = NSComparisonPredicate(
leftExpression: NSExpression(forKeyPath: lhs),
rightExpression: NSExpression(forConstantValue: rhs),
modifier: .direct,
type: .greaterThan,
options: []
)

return Predicate<S>(from: predicate)
}

public func > <S, C: Comparable>(lhs: KeyPath<S, C?>, rhs: C?) -> Predicate<S> {
let predicate = NSComparisonPredicate(
leftExpression: NSExpression(forKeyPath: lhs),
rightExpression: NSExpression(forConstantValue: rhs),
modifier: .direct,
type: .equalTo,
options: []
leftExpression: NSExpression(forKeyPath: lhs),
rightExpression: NSExpression(forConstantValue: rhs),
modifier: .direct,
type: .greaterThan,
options: []
)

return Predicate<S>(from: predicate)
Expand All @@ -29,11 +94,11 @@ public func == <S, E: Equatable>(lhs: KeyPath<S,E>, rhs: E) -> Predicate<S> {
infix operator -->: AdditionPrecedence
public func --> <S, E: Hashable>(lhs: KeyPath<S, E>, rhs: Set<E>) -> Predicate<S> {
let predicate = NSComparisonPredicate(
leftExpression: NSExpression(forKeyPath: lhs),
rightExpression: NSExpression(forConstantValue: rhs),
modifier: .direct,
type: .in,
options: []
leftExpression: NSExpression(forKeyPath: lhs),
rightExpression: NSExpression(forConstantValue: rhs),
modifier: .direct,
type: .in,
options: []
)

return Predicate<S>(from: predicate)
Expand Down
8 changes: 6 additions & 2 deletions CoreDataStack/Mask.xcdatamodeld/Mask.xcdatamodel/contents
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,23 @@
<entity name="UploadFile" representedClassName=".UploadFile" syncable="YES">
<attribute name="content" optional="YES" attributeType="Binary"/>
<attribute name="createdAt" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="encrypted" optional="YES" attributeType="String"/>
<attribute name="fileSize" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="fileType" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="id" optional="YES" attributeType="String"/>
<attribute name="key" optional="YES" attributeType="String"/>
<attribute name="landingTxID" optional="YES" attributeType="String"/>
<attribute name="mime" optional="YES" attributeType="String"/>
<attribute name="meson" optional="YES" attributeType="String"/>
<attribute name="name" optional="YES" attributeType="String"/>
<attribute name="payloadTxID" optional="YES" attributeType="String"/>
<attribute name="provider" optional="YES" attributeType="String"/>
<attribute name="uploadOption" optional="YES" attributeType="String"/>
<uniquenessConstraints>
<uniquenessConstraint>
<constraint value="id"/>
<constraint value="landingTxID"/>
<constraint value="payloadTxID"/>
<constraint value="encrypted"/>
<constraint value="meson"/>
</uniquenessConstraint>
</uniquenessConstraints>
</entity>
Expand Down
39 changes: 39 additions & 0 deletions CoreDataStackTests/CoreDataStackTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,31 @@
@testable import CoreDataStack
import XCTest

@objcMembers
final class Person: NSObject {
let name: String?
let date: Date
let id: String

let pet: Pet

init(name: String?, date: Date, id: String) {
self.name = name
self.date = date
self.id = id
self.pet = .init(name: name)
}

@objcMembers
final class Pet: NSObject {
let name: String?

init(name: String?) {
self.name = name
}
}
}

class CoreDataStackTests: XCTestCase {
override func setUpWithError() throws {
try super.setUpWithError()
Expand All @@ -31,4 +56,18 @@ class CoreDataStackTests: XCTestCase {
// Put the code you want to measure the time of here.
}
}

func testPredicates() {
let persons = [
Person(name: "mike", date: Date(timeIntervalSince1970: 8), id: "113"),
.init(name: "tale", date: Date(), id: "daa"),
.init(name: nil, date: Date(), id: "131")
]

// note Int? is not supported by predicate
let agePredicate = \Person.date > Date()

let result = persons.filter { agePredicate.evaluate(with: $0) }
XCTAssert(result.first?.name != "mike")
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading