Skip to content

build: Release beta #1589

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 11 commits into from
Nov 3, 2022
14 changes: 14 additions & 0 deletions changelogs/CHANGELOG_alpha.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# [3.5.0-alpha.8](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.0-alpha.7...3.5.0-alpha.8) (2022-11-03)


### Bug Fixes

* File upload fails when uploading base64 data ([#1578](https://github.com/parse-community/Parse-SDK-JS/issues/1578)) ([03ee3ff](https://github.com/parse-community/Parse-SDK-JS/commit/03ee3ffd3e4798f9dd958ddc24b9f774cb875507))

# [3.5.0-alpha.7](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.0-alpha.6...3.5.0-alpha.7) (2022-11-01)


### Bug Fixes

* React Native build does not maintain arrow functions and causes error with AsyncStorage ([#1587](https://github.com/parse-community/Parse-SDK-JS/issues/1587)) ([8aeaa4f](https://github.com/parse-community/Parse-SDK-JS/commit/8aeaa4f51e01f5763c497b5e86dca73835e2144b))

# [3.5.0-alpha.6](https://github.com/parse-community/Parse-SDK-JS/compare/3.5.0-alpha.5...3.5.0-alpha.6) (2022-10-13)


Expand Down
8 changes: 7 additions & 1 deletion integration/test/ParseFileTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Parse.File', () => {
assert.equal(data, 'ParseA==');
});

it('can get file data from base64', async () => {
it('can get file data from base64 (saved)', async () => {
const file = new Parse.File('parse-server-logo', { base64: 'ParseA==' });
await file.save();
let data = await file.getData();
Expand All @@ -76,6 +76,12 @@ describe('Parse.File', () => {
assert.equal(data, 'ParseA==');
});

it('can get file data from base64 (unsaved)', async () => {
const file = new Parse.File('parse-server-logo', { base64: 'ParseA==' });
const data = await file.getData();
assert.equal(data, 'ParseA==');
});

it('can get file data from full base64', async () => {
const file = new Parse.File('parse-server-logo', {
base64: 'data:image/jpeg;base64,ParseA==',
Expand Down
108 changes: 54 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parse",
"version": "3.5.0",
"version": "3.5.0-alpha.8",
"description": "The Parse JavaScript SDK",
"homepage": "https://parseplatform.org/",
"keywords": [
Expand Down
5 changes: 4 additions & 1 deletion src/ParseFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ class ParseFile {
} else if (data && typeof data.base64 === 'string') {
const base64 = data.base64.split(',').slice(-1)[0];
const dataType =
specifiedType || data.base64.split(';').slice(0, 1)[0].split(':').slice(1, 2)[0] || 'text/plain';
specifiedType ||
data.base64.split(';').slice(0, 1)[0].split(':').slice(1, 2)[0] ||
'text/plain';
this._data = base64;
this._source = {
format: 'base64',
base64,
Expand Down
19 changes: 7 additions & 12 deletions src/StorageController.react-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,14 @@
* @flow
* @private
*/

import CoreManager from './CoreManager';

const StorageController = {
async: 1,

getAsyncStorage(): any {
return CoreManager.getAsyncStorage();
},

getItemAsync(path: string): Promise {
return new Promise((resolve, reject) => {
this.getAsyncStorage().getItem(path, function (err, value) {
CoreManager.getAsyncStorage().getItem(path, (err, value) => {
if (err) {
reject(err);
} else {
Expand All @@ -33,7 +28,7 @@ const StorageController = {

setItemAsync(path: string, value: string): Promise {
return new Promise((resolve, reject) => {
this.getAsyncStorage().setItem(path, value, function (err, value) {
CoreManager.getAsyncStorage().setItem(path, value, (err, value) => {
if (err) {
reject(err);
} else {
Expand All @@ -45,7 +40,7 @@ const StorageController = {

removeItemAsync(path: string): Promise {
return new Promise((resolve, reject) => {
this.getAsyncStorage().removeItem(path, function (err) {
CoreManager.getAsyncStorage().removeItem(path, (err) => {
if (err) {
reject(err);
} else {
Expand All @@ -57,7 +52,7 @@ const StorageController = {

getAllKeysAsync(): Promise {
return new Promise((resolve, reject) => {
this.getAsyncStorage().getAllKeys(function (err, keys) {
CoreManager.getAsyncStorage().getAllKeys((err, keys) => {
if (err) {
reject(err);
} else {
Expand All @@ -69,7 +64,7 @@ const StorageController = {

multiGet(keys: Array<string>): Promise<Array<Array<string>>> {
return new Promise((resolve, reject) => {
this.getAsyncStorage().multiGet(keys, function (err, result) {
CoreManager.getAsyncStorage().multiGet(keys, (err, result) => {
if (err) {
reject(err);
} else {
Expand All @@ -81,7 +76,7 @@ const StorageController = {

multiRemove(keys: Array<string>): Promise {
return new Promise((resolve, reject) => {
this.getAsyncStorage().multiRemove(keys, function (err) {
CoreManager.getAsyncStorage().multiRemove(keys, (err) => {
if (err) {
reject(err);
} else {
Expand All @@ -92,7 +87,7 @@ const StorageController = {
},

clear() {
return this.getAsyncStorage().clear();
return CoreManager.getAsyncStorage().clear();
},
};

Expand Down
Loading