Skip to content

Commit a33ca50

Browse files
authored
Merge branch 'master' into addParseLiveQuery
2 parents f7405fc + abfbd07 commit a33ca50

File tree

30 files changed

+193
-140
lines changed

30 files changed

+193
-140
lines changed

.github/workflows/release-automated.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
persist-credentials: false
1818
- uses: actions/setup-node@v2
1919
with:
20-
node-version: 14
20+
node-version: 18
2121
- name: Setup Ruby
2222
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
2323
- name: Cache Gems
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: release-manual-docs
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
tag:
6+
default: ''
7+
description: 'Version tag:'
8+
env:
9+
CI_XCODE_13: '/Applications/Xcode_13.4.1.app/Contents/Developer'
10+
11+
jobs:
12+
publish-docs:
13+
if: github.event.inputs.tag != ''
14+
runs-on: macos-11
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
with:
19+
ref: ${{ github.event.inputs.tag }}
20+
- name: Cache Gems
21+
id: cache-gems
22+
uses: actions/cache@v2
23+
with:
24+
path: vendor/bundle
25+
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
26+
restore-keys: |
27+
${{ runner.os }}-gem-
28+
- name: Install Bundle
29+
run: |
30+
bundle config path vendor/bundle
31+
bundle install
32+
- name: Create Jazzy Docs
33+
run: |
34+
./Scripts/jazzy.sh
35+
env:
36+
DEVELOPER_DIR: ${{ env.CI_XCODE_13 }}
37+
- name: Deploy Jazzy Docs
38+
uses: peaceiris/actions-gh-pages@v3
39+
with:
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
publish_dir: ./docs

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## [2.1.1](https://github.com/parse-community/Parse-SDK-iOS-OSX/compare/2.1.0...2.1.1) (2023-02-26)
2+
3+
4+
### Performance Improvements
5+
6+
* Skip registering auth delegate if it's already registered ([#1715](https://github.com/parse-community/Parse-SDK-iOS-OSX/issues/1715)) ([6d7eadd](https://github.com/parse-community/Parse-SDK-iOS-OSX/commit/6d7eadd322d3ac2f011c33d9dbee89b9e051e744))
7+
8+
# [2.1.0](https://github.com/parse-community/Parse-SDK-iOS-OSX/compare/2.0.3...2.1.0) (2023-02-22)
9+
10+
11+
### Features
12+
13+
* Add `PFUser.unregisterAuthenticationDelegate` and allow to register delegate gracefully if another delegate is already registered ([#1711](https://github.com/parse-community/Parse-SDK-iOS-OSX/issues/1711)) ([0ef9351](https://github.com/parse-community/Parse-SDK-iOS-OSX/commit/0ef93517136d668991b0226643e06bb15982935c))
14+
15+
## [2.0.3](https://github.com/parse-community/Parse-SDK-iOS-OSX/compare/2.0.2...2.0.3) (2023-02-20)
16+
17+
18+
### Bug Fixes
19+
20+
* `Parse.setServer` does not set new server URL ([#1708](https://github.com/parse-community/Parse-SDK-iOS-OSX/issues/1708)) ([fd487da](https://github.com/parse-community/Parse-SDK-iOS-OSX/commit/fd487da490d7a3ad3f49c86ffde28973d7ef7f71))
21+
122
## [2.0.2](https://github.com/parse-community/Parse-SDK-iOS-OSX/compare/2.0.1...2.0.2) (2023-01-30)
223

324

CONTRIBUTING.md

Lines changed: 44 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,47 @@
1-
# Contributing to the Parse SDK for iOS/OS X
2-
We want to make contributing to this project as easy and transparent as possible.
1+
# Contributing to the Parse Apple SDK <!-- omit in toc -->
2+
3+
- [Contributing](#contributing)
4+
- [Bugs](#bugs)
5+
- [Known Issues](#known-issues)
6+
- [Reporting Issues](#reporting-issues)
7+
- [Security Bugs](#security-bugs)
8+
- [Code of Conduct](#code-of-conduct)
9+
10+
# Contributing
11+
12+
For analyzing bugs, creating bug fixes and features we recommend to clone this repository locally and add it as a local package to your Xcode project. This way you can edit and inspect the Parse SDK while running your app. You can find step-by-step instructions for how do that in the [Xcode docs](https://developer.apple.com/documentation/xcode/editing-a-package-dependency-as-a-local-package).
13+
14+
1. Fork the repository and create a new branch.
15+
2. Add unit tests for any new code you add.
16+
- Core Module - [/Parse/Tests/Unit/](/Parse/Tests/Unit/)
17+
- Facebook Utils - [/ParseFacebookUtils/Tests/Unit/](/ParseFacebookUtils/Tests/Unit/)
18+
- Twitter Utils - [/ParseTwitterUtils/Tests/Unit/](/ParseTwitterUtils/Tests/Unit/)
19+
3. If you've changed APIs, update the documentation and the [iOS Guide](https://github.com/parse-community/docs/tree/gh-pages/_includes/ios).
20+
4. Ensure the test suite passes.
21+
You can run the tests in the command line with rake.
22+
23+
Install all dependencies:
24+
```
25+
git submodule update --init --recursive
26+
gem install bundler
27+
bundle install
28+
```
29+
Run the tests:
30+
```
31+
bundle exec rake test:ios
32+
```
33+
Check the [Rakefile](Rakefile) and the [GitHub workflows](.github/workflows) for more information.
34+
35+
# Bugs
36+
37+
Although we try to keep developing with the Parse Platform easy, you still may run into some issues. General questions should be asked in our [community forum](community-forum), technical questions should be asked on [Stack Overflow][stack-overflow], and for everything else we use GitHub issues.
38+
39+
## Known Issues
340

4-
## Our Development Process
5-
6-
### `master` is unsafe
7-
Our goal is to keep `master` stable, but there may be changes that your application may not be compatible with. We'll do our best to publicize any breaking changes, but try to use specific releases in any production environment.
8-
9-
### Pull Requests
10-
We actively welcome your pull requests. When we get one, we'll run some Parse-specific integration tests on it first. From here, we'll need to get a core member to sign off on the changes and then merge the pull request.
11-
12-
#### 1. Fork the repo and create your branch from `master`.
13-
14-
#### 2. Add unit tests for any new code you add.
15-
- Main SDK - [/Parse/Tests/Unit/](/Parse/Tests/Unit/)
16-
- Facebook Utils - [/ParseFacebookUtils/Tests/Unit/](/ParseFacebookUtils/Tests/Unit/)
17-
- Twitter Utils - [/ParseTwitterUtils/Tests/Unit/](/ParseTwitterUtils/Tests/Unit/)
18-
19-
#### 3. If you've changed APIs, update the documentation and the [iOS Guide](https://github.com/parse-community/docs/tree/gh-pages/_includes/ios)
20-
21-
#### 4. Ensure the test suite passes.
22-
You can run the tests in the command line with rake.
23-
24-
Install all dependencies:
25-
```
26-
git submodule update --init --recursive
27-
gem install bundler
28-
bundle install
29-
```
30-
Run the tests:
31-
```
32-
bundle exec rake test:ios
33-
```
34-
Check the Rakefile and the circleci config for more information.
35-
36-
#### 5. Make sure your code follows the [style guide](#style-guide)
37-
38-
### Preparing for a new release
39-
40-
#### Update the version number
41-
42-
You can use the rake task in order to bump the version number, it's safe, and will properly update all version numbers
43-
44-
```
45-
$ bundle exec rake package:set_version[X.X.X]
46-
```
47-
48-
Note that zsh users (such as those using macOS >= 10.15) need to escape the brackets as follows:
49-
50-
```
51-
$ bundle exec rake package:set_version\[X.X.X\]
52-
```
53-
54-
Replace X.X.X by the version number and push to the repository.
55-
56-
## Bugs
57-
Although we try to keep developing with the Parse Platform easy, you still may run into some issues. General questions should be asked on our [community forum](community-forum), technical questions should be asked on [Stack Overflow][stack-overflow], and for everything else we use GitHub issues.
58-
59-
### Known Issues
6041
We use GitHub issues to track public bugs. We keep a close eye on this and try to make it clear when a fix is in progress. Before filing a new issue, check existing issues for the same problem.
6142

62-
### Reporting New Issues
43+
## Reporting Issues
44+
6345
Not all issues are SDK issues. If you're unsure whether your bug is with the SDK or backend, you can test to see if it reproduces with our [REST API][rest-api] and Parse Dashboard API Console. If it does, you can [report bugs on the Parse Server repository](https://github.com/parse-community/parse-server/issues/new/choose).
6446

6547
To view the REST API network requests issued by the Parse SDK, please check out our [Network Debugging Tool][network-debugging-tool].
@@ -73,19 +55,12 @@ Details are key. The more information you provide us the easier it'll be for us
7355
* Anything else you find relevant.
7456

7557

76-
### Security Bugs
77-
Please follow our [security documentation](https://github.com/parse-community/.github/blob/master/SECURITY.md) for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue.
78-
79-
## Style Guide
80-
We're still working on providing a code style for your IDE and getting a linter on GitHub, but for now try to keep the following:
81-
82-
* Most importantly, match the existing code style as much as possible.
83-
* Try to keep lines under 120 characters, if possible.
58+
## Security Bugs
8459

85-
## License
86-
By contributing to Parse iOS/OSX SDK, you agree that your contributions will be licensed under its license.
60+
Please follow our [security documentation](https://github.com/parse-community/.github/blob/master/SECURITY.md) for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue.
8761

8862
# Code of Conduct
63+
8964
This project adheres to the [Contributor Covenant Code of Conduct](https://github.com/parse-community/.github/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to honor this code.
9065

9166
[stack-overflow]: http://stackoverflow.com/tags/parse-platform

Parse/Parse/Internal/PFInternalUtils.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919

2020
@interface PFInternalUtils : NSObject
2121

22-
+ (NSString *)parseServerURLString;
23-
+ (void)setParseServer:(NSString *)server;
24-
2522
/**
2623
Clears system time zone cache, gets the name of the time zone
2724
and caches it. This method is completely thread-safe.

Parse/Parse/Internal/PFInternalUtils.m

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,8 @@
4040
#import "PFProduct.h"
4141
#endif
4242

43-
static NSString *parseServer_;
44-
4543
@implementation PFInternalUtils
4644

47-
+ (void)initialize {
48-
if (self == [PFInternalUtils class]) {
49-
[self setParseServer:_ParseDefaultServerURLString];
50-
}
51-
}
52-
53-
+ (NSString *)parseServerURLString {
54-
return parseServer_;
55-
}
56-
57-
// Useful for testing.
58-
// Beware of race conditions if you call setParseServer while something else may be using
59-
// httpClient.
60-
+ (void)setParseServer:(NSString *)server {
61-
parseServer_ = [server copy];
62-
}
63-
6445
+ (NSString *)currentSystemTimeZoneName {
6546
static NSLock *methodLock;
6647
static dispatch_once_t onceToken;

Parse/Parse/Internal/User/AuthenticationProviders/Controller/PFUserAuthenticationController.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,20 @@ - (void)registerAuthenticationDelegate:(id<PFUserAuthenticationDelegate>)delegat
5555
forAuthType:(NSString *)authType {
5656
PFParameterAssert(delegate, @"Authentication delegate can't be `nil`.");
5757
PFParameterAssert(authType, @"`authType` can't be `nil`.");
58-
PFParameterAssert(![self authenticationDelegateForAuthType:authType],
59-
@"Authentication delegate already registered for authType `%@`.", authType);
58+
59+
// If auth delete is already registered for provider
60+
if ([self authenticationDelegateForAuthType:authType]) {
61+
62+
// If same auth delete is already registered then don't register it again
63+
if ([self authenticationDelegateForAuthType:authType] == delegate) {
64+
NSLog(@"skipping registering as same delegate already registered for authType `%@`.", authType);
65+
return;
66+
}
67+
68+
NSLog(@"unregistering existing deletegate to gracefully register new delegate for authType `%@`.", authType);
69+
[self unregisterAuthenticationDelegateForAuthType:authType];
70+
}
71+
6072
dispatch_sync(_dataAccessQueue, ^{
6173
self->_authenticationDelegates[authType] = delegate;
6274
});

Parse/Parse/Resources/Parse-OSX.Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
<key>CFBundlePackageType</key>
1414
<string>FMWK</string>
1515
<key>CFBundleShortVersionString</key>
16-
<string>2.0.2</string>
16+
<string>2.1.1</string>
1717
<key>CFBundleSignature</key>
1818
<string>????</string>
1919
<key>CFBundleVersion</key>
20-
<string>2.0.2</string>
20+
<string>2.1.1</string>
2121
</dict>
2222
</plist>

Parse/Parse/Resources/Parse-iOS.Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
<key>CFBundlePackageType</key>
1414
<string>FMWK</string>
1515
<key>CFBundleShortVersionString</key>
16-
<string>2.0.2</string>
16+
<string>2.1.1</string>
1717
<key>CFBundleSignature</key>
1818
<string>????</string>
1919
<key>CFBundleSupportedPlatforms</key>
2020
<array>
2121
<string>iPhoneOS</string>
2222
</array>
2323
<key>CFBundleVersion</key>
24-
<string>2.0.2</string>
24+
<string>2.1.1</string>
2525
<key>MinimumOSVersion</key>
2626
<string>9.0</string>
2727
</dict>

Parse/Parse/Resources/Parse-tvOS.Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.0.2</string>
18+
<string>2.1.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>2.0.2</string>
22+
<string>2.1.1</string>
2323
<key>NSPrincipalClass</key>
2424
<string></string>
2525
</dict>

Parse/Parse/Resources/Parse-watchOS.Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.0.2</string>
18+
<string>2.1.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>2.0.2</string>
22+
<string>2.1.1</string>
2323
<key>NSPrincipalClass</key>
2424
<string></string>
2525
</dict>

Parse/Parse/Source/PFConstants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#pragma mark - SDK Version
1515
///--------------------------------------
1616

17-
#define PARSE_VERSION @"2.0.2"
17+
#define PARSE_VERSION @"2.1.1"
1818

1919
///--------------------------------------
2020
#pragma mark - Platform

Parse/Parse/Source/PFUser.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ typedef void(^PFUserLogoutResultBlock)(NSError *_Nullable error);
283283
///--------------------------------------
284284

285285
/**
286-
Registers a third party authentication delegate.
286+
Registers a third party authentication delegate. If a delegate is already registered for the authType then
287+
it is replaced by the new delegate.
287288
288289
@note This method shouldn't be invoked directly unless developing a third party authentication library.
289290
@see PFUserAuthenticationDelegate
@@ -293,6 +294,16 @@ typedef void(^PFUserLogoutResultBlock)(NSError *_Nullable error);
293294
*/
294295
+ (void)registerAuthenticationDelegate:(id<PFUserAuthenticationDelegate>)delegate forAuthType:(NSString *)authType;
295296

297+
/**
298+
Unregisters a third party authentication delegate. If no delegate is registered, this fails gracefully.
299+
300+
@note This method shouldn't be invoked directly unless developing a third party authentication library.
301+
@see PFUserAuthenticationDelegate
302+
303+
@param authType The name of the type of third party authentication source.
304+
*/
305+
+ (void)unregisterAuthenticationDelegateForAuthType:(NSString *)authType;
306+
296307
/**
297308
Logs in a user with third party authentication credentials.
298309

Parse/Parse/Source/PFUser.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,10 @@ + (void)registerAuthenticationDelegate:(id<PFUserAuthenticationDelegate>)delegat
848848
[[self authenticationController] registerAuthenticationDelegate:delegate forAuthType:authType];
849849
}
850850

851+
+ (void)unregisterAuthenticationDelegateForAuthType:(NSString *)authType {
852+
[[self authenticationController] unregisterAuthenticationDelegateForAuthType:authType];
853+
}
854+
851855
#pragma mark Log In
852856

853857
+ (BFTask<__kindof PFUser *> *)logInWithAuthTypeInBackground:(NSString *)authType

Parse/Parse/Source/Parse.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,13 @@ NS_ASSUME_NONNULL_BEGIN
107107
@property (nonatomic, nullable, readonly, class) ParseClientConfiguration *currentConfiguration;
108108

109109
/**
110-
Sets the server URL to connect to Parse Server. The local client cache is not cleared.
111-
@discussion This can be used to update the server URL after this client has been initialized, without having to destroy this client. An example use case is
112-
server connection failover, where the clients connects to another URL if the server becomes unreachable at the current URL.
113-
@warning The new server URL must point to a Parse Server that connects to the same database. Otherwise, issues may arise
114-
related to locally cached data or delayed methods such as saveEventually.
110+
Sets the server URL to connect to Parse Server.
111+
@discussion This can be used to update the server URL after the client was initialized. An example use case is server
112+
connection failover, where the client connects to another URL if the server becomes unreachable at the current URL. The
113+
client will be re-initialized maintaining the same configuration. Any pending requests will still be made against the previous
114+
server URL that was set at the time the request was queued.
115+
@warning The new server URL must point to a Parse Server that connects to the same database. Otherwise, issues may
116+
arise related to locally cached data or delayed methods such as saveEventually.
115117
@param server The server URL to set.
116118
*/
117119
+ (void)setServer:(nonnull NSString *)server;

0 commit comments

Comments
 (0)