The functionality in the React Native code that uploads images to an S3 bucket is currently failing to initiate the network request

I have been using a redux-observable epic to upload images to my AWS S3 bucket through react-native-aws3. It has been functioning smoothly for quite some time. However, recently it seems to have stopped entering the .map and .catch blocks of code. I suspect that it may not even be initiating a network request anymore. What could possibly be causing this unexpected behavior?

Here is the code snippet:

//@flow

import { RNS3 } from 'react-native-aws3'
import 'redux-observable'
import { Observable } from 'rxjs'
// $FlowFixMe
import 'rxjs/add/operator/catch'
// $FlowFixMe
import { ajax } from 'rxjs/observable/dom/ajax'
import type { VepoState } from 'src/components/model'
import type { RecordOf } from 'immutable'

import {
  updateAlertModalIsOpen,
  updateAlertModalMessage,
  updateAlertModalTitle
} from 'src/components/formControls/alertModal/action'
import Toast from 'react-native-root-toast'

import 'redux-observable'
import { s3options } from 'src/components/model'
import type { Epic, ActionsObservable } from 'redux-observable'
import type { RequestFulfilledDto, RequestRejectedDto } from 'src/model/ajax'
import {
  uploadAddProductImageFulfilled,
  uploadAddProductImageRejected,
  updateAddProductImageInDb,
  updateAddProductImageInDbFulfilled,
  updateAddProductImageInDbRejected,
  UPLOAD_ADD_PRODUCT_IMAGE,
  UPLOAD_ADD_PRODUCT_IMAGE_FULFILLED,
  UPLOAD_ADD_PRODUCT_IMAGE_REJECTED,
  UPDATE_ADD_PRODUCT_IMAGE_IN_DB,
  UPDATE_ADD_PRODUCT_IMAGE_IN_DB_FULFILLED,
  UPDATE_ADD_PRODUCT_IMAGE_IN_DB_REJECTED,
  UPLOAD_ADD_PRODUCT,
  UPLOAD_ADD_PRODUCT_FULFILLED,
  UPLOAD_ADD_PRODUCT_REJECTED,
  uploadAddProductFulfilled,
  uploadAddProductRejected,
  updateAddProductId
} from './action'
import { deselectAllCategories } from 'src/components/formControls/categoriesMultiselect/action'
import {
  updateLocationAutocompleteSearchText,
  updateShouldHideLocationResults,
  updateLocationAutocompletePlace,
  updateLocationListDisplayed
} from 'src/components/formControls/locationAutocomplete/redux'
import { updateProductImageLink } from 'src/components/formControls/imagePicker/redux'

import { uploadAddProductImage } from 'src/components/product/add/groceryItem/action'


export const uploadAddProductImageEpic = (action$: ActionsObservable<string>) =>
      action$.ofType(UPLOAD_ADD_PRODUCT_IMAGE).mergeMap((action) => {
        return Observable.fromPromise(RNS3.put(action.payload, action.config))
          .map((response) => {
            return uploadAddProductImageFulfilled(response)
          })
          .catch((error) => {
            return Observable.of(uploadAddProductImageRejected(error))
          })
      })

Answer №1

The unexpected downtime of the AWS management console caught me off guard, but surprisingly everything seems to be functioning normally now. I was half-expecting a 404 http response when trying to access it during the downtime, but for some reason the network request never went through. It's always interesting how technology behaves in unforeseen situations like this.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Guide to converting a log string into JSON using Javascript

I encountered a console log that appears as follows: 2021-01-06T09:06:05.541212726Z D saveGarment: Function execution took 736 ms, finished with status code: 204 2021-01-06T09:06:10.844901031Z D saveGarment: Function execution started 2021-01-06T09:06:16.1 ...

Why my attempts to alter numerous CSS elements using JQuery are failing?

Here's the code snippet I'm working with: var showThis = $(this).attr('id'); // div0, div1, div2 etc. $('#' + showThis).attr('style', 'background-color: #063 !important, height: 520px'); I am trying to mo ...

My component fails to load using Angular Router even though the URL is correct

I have been experiencing an issue while trying to load my Angular component using the router. The component never appears on the screen and there are no error messages displayed. app-routing-module { path: '', redirectTo: '/home', ...

Tips for verifying whether a variable is a node?

Curiosity strikes me: how can I determine if the variable myVar is a node? I could simply check myVar.nodeType, but that might be misleading with something like {nodeType:1} So, naturally, I start to wonder if there's a way to do this instead: myVa ...

Is there a way to pass locale data using props in VueJS Router?

To access hotel data, the URL path should be localhost:8080/hotel/:id (where id is equal to json.hoteID). For example, localhost:8080/hotel/101 This path should display the specific data for that hotel. In order to achieve this, we will utilize VueJS vu ...

Exploring the variations between getRequestHandler and render functions in Custom Next.js applicationsIn a

Greetings, I found it quite unexpected that there is a lack of information available on the functionalities of the getRequestHandler and render functions within the next package. As I am in the process of setting up a custom server, I am curious about wh ...

Guide to tallying the occurrences of a specific key within an object array and attaching the count to each key's current value

Is there a way to determine the number of occurrences of the 'value' key within an object that is part of an array, and then add the count to each value if applicable? In this case, 'a' represents the original data var a = [ { id: ...

What is the mechanism behind sprites in three.js?

I've encountered a problem with my scene that includes numerous sprites and results in a poor frame rate. I attempted to improve performance by reducing sprite resolution and adjusting camera limitations for render distance, but unfortunately, it had ...

`The universal functionality of body background blur is inconsistent and needs improvement.`

I've developed a modal that blurs the background when the modal window is opened. It's functioning flawlessly with one set of HTML codes, but encountering issues with another set of HTML codes (which seems odd considering the identical CSS and Ja ...

Using the power of jQuery, execute a function only once when the element is clicked

My goal is to use jQuery's .one method to change the color of an element only once, even if clicked again. However, I am having trouble getting it to work properly. Here is my HTML: <!DOCTYPE html> <head> <meta charset="UTF-8"& ...

Unable to establish connection with remote database server on Hostinger platform

I've been encountering this persistent error that I can't seem to resolve. I developed my project locally, utilizing a local database. Upon completion, I attempted to manually migrate my database to my hosting provider since it's relatively ...

A guide to updating a button in Angular:

Currently, I have implemented a directive that displays 3 tabs at the bottom. However, I am curious to know if it is possible to swap out "exterior" for "interior" based on whether I am on the exterior or interior page. For example, when on the exterior ...

I am looking to dynamically generate HTML elements using AngularJS based on data from a JSON file

Although there are existing answers to this question, I have a specific approach that I need help with. I've already made progress but could use some guidance. This is my Controller : angular.module('dynamicForm.home-ctrl',[]) .con ...

What is the best way to update the state by either adding to it or replacing it if the key

I'm currently working on a project involving radio buttons and I need to create dynamic state by setting the initial state on the first click, then updating it with subsequent clicks by either concatenating the new value onto the existing state or rep ...

Developing a table with JavaScript by parsing JSON data

Starting off, I am relatively new to working with JavaScript. Recently, I attempted to generate a table using data from a JSON file. After researching and following some tutorials, I successfully displayed the table on a web browser. However, I noticed tha ...

Tips for extracting the most deeply nested object in a JSON file using JavaScript

Is it possible to access the innermost object without knowing the path names? Consider this JSON example: const data = { first: { second: { third: {innerObject} } } ...

Updating a Div on your webpage using a JQuery UI dialog: A step-by-step guide

I am currently trying to update my webpage from a JQuery UI dialog, but the code I have so far does not seem to be working. Any assistance or guidance would be greatly appreciated. function submit_new_site() { // These are the input text IDs on the ...

Discovering the method for accessing a variable within jQuery from a regular JavaScript function

As someone new to jQuery, I am currently facing a challenge with accessing a variable defined inside a jQuery block from a regular function. Despite my attempts, I have been unsuccessful in accessing it. Can anyone guide me on how to do this? <script l ...

Using Vue3 to create a dynamic reference in a computed status, allowing for the repetition of a player multiple times in a table along with a play/pause

On the Vue3 page below, I have successfully integrated a player that displays a "play" icon when the player is stopped and a "pause" icon when it's playing. Now, my goal is to allow the player to repeat n times by placing it in a table. The challeng ...

Once the if condition is implemented, the functionality of the toggle button ceases to operate

Take a look at this demo link: http://jsbin.com/labuxuziraya/1/edit I encountered an issue where the button stops working after adding an if condition. I suspect there are some minor bugs in the code, but my level of experience is not enough to pinpoint t ...